Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenLayers 2.10 Beginner's Guide

You're reading from   OpenLayers 2.10 Beginner's Guide Create, optimize, and deploy stunning cross-browser web maps with the OpenLayers JavaScript web mapping library

Arrow left icon
Product type Paperback
Published in Mar 2011
Publisher
ISBN-13 9781849514125
Length 372 pages
Edition Edition
Languages
Arrow right icon
Toc

Table of Contents (18) Chapters Close

OpenLayers 2.10
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with OpenLayers FREE CHAPTER 2. Squashing Bugs With Firebug 3. The 'Layers' in OpenLayers 4. Wrapping Our Heads Around Projections 5. Interacting with Third Party APIs 6. Taking Control of Controls 7. Styling Controls 8. Charting the Map Class 9. Using Vector Layers 10. Vector Layer Style Guide 11. Making Web Map Apps Index

Behind the scenes—Object Oriented Programming (OOP)


Now, let's talk about how this stuff works from a more theoretical and technical level. OpenLayers employs Object Oriented Programming (OOP) techniques, meaning that to use with the library, we create objects from built in classes that OpenLayers provides.

What does this mean? You already are familiar with what classes and objects are, but you just may not know it. Think of the concepts of a class and object in terms of the parts of speech. For example, think of what the abstract idea of a noun means—a person, place, thing, or idea. Noun itself (the abstract idea) is a class. But the actual, concrete words that qualify as a noun are objects.

Interaction happens with objects

Ironman and Batman are two separate words (or, in terms of OOP, two objects), but they belong to the same noun class. A class is primarily used to generate objects; we interact with objects. Consider these two sentences:

"Noun was in a fight with noun."

"Ironman was in a fight with Batman."

Now, the second sentence is more of an actual sentence. We use the words Ironman and Batman in the sentence (which are objects; they are instances of the noun class). We don't use noun (a class) in the sentence, because interacting with a class like this doesn't make much sense. This is one of the important concepts of OOP—we interact with objects, and we generate objects through classes.

MadLibs

Madlibs, for those unfamiliar with it, is a game where you are given text with some missing words. The point is to come up with words to fill in the blanks, but each blank can only contain a certain type of word (noun, adjective, verb, and so on). The type of word is a class and the actual word you insert is an object.

You have been reading a chapter from
OpenLayers 2.10 Beginner's Guide
Published in: Mar 2011
Publisher:
ISBN-13: 9781849514125
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime