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 />

Table A-27. The Methods of the Polygon Class<br />

Method Return Value Description<br />

getMap() Map Returns a reference to the map the<br />

polygon is attached to.<br />

getPath() MVCArray. Returns the first path.<br />

getPaths()<br />

MVCArray.<br />

<br />

Returns all the paths for the polygon.<br />

setMap(map:Map) None Adds the polygon to a map. To remove<br />

the polygon from a map, pass null as<br />

the value.<br />

setOptions(options:PolygonOptions) None Sets the features of the polyline by<br />

passing a PolygonOptions object.<br />

setPath(path:MVCArray.|<br />

Array.)<br />

setPaths(paths:<br />

MVCArray.|<br />

MVCArray.|<br />

Array.|<br />

Array.)<br />

None<br />

None<br />

Sets the first path of the polygon.<br />

Sets all the paths for the polygon.<br />

Events<br />

Table A-28 gives the events of the Polygon class.<br />

Table A-28. The Events of the Polygon Class<br />

Event Argument Description<br />

click MouseEvent Fires when the polygon is being clicked<br />

dblclick MouseEvent Fires when the polygon is being double-clicked<br />

mousedown MouseEvent Fires when the user press down the left mouse key on the polygon<br />

mousemove MouseEvent Fires when the DOM mouse move event is triggered on the<br />

polygon<br />

mouseout MouseEvent Fires when the mouse leaves the area over the polygon<br />

mouseover MouseEvent Fires when the mouse enters the area over the polygon<br />

264

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

Saved successfully!

Ooh no, something went wrong!