27.10.2014 Views

Google Maps API 3

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

APPENDIX ■ <strong>API</strong> REFERENCE<br />

The Namespace<br />

All the classes of the <strong>Google</strong> <strong>Maps</strong> <strong>API</strong> reside in the namespace google.maps. That means whatever<br />

class or method you want to call always starts with google.maps. Here’s, for example, how to call the<br />

constructor for the Marker class:<br />

new google.maps.Marker();<br />

So, whenever you need to use a class or object, make sure to always insert the namespace name in<br />

front of it.<br />

The Reference<br />

Use the following sections as reference.<br />

Map Class<br />

This class contains all the method and properties for creating a map. It extends MVCObject (described<br />

later).<br />

Constructor<br />

Table A-1 shows the constructor of the Map class.<br />

Table A-1. Constructor of the Map Class<br />

Constructor<br />

Map(mapDiv:Node, opts?:MapOptions)<br />

Description<br />

This is the constructor for the entire Map object. It creates a<br />

new map inside mapDiv, which is typically a reference to a<br />

in the HTML. This is of type MapOptions.<br />

244

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!