Home

Awesome

google.maps.Polygon.moveTo()

Programmatically move a google.maps.Polygon to a new google.maps.LatLng using Google Maps V3 Built by Bramus! - http://www.bram.us/

About

Since Google Maps v3.11 it's possible to move around a google.maps.Polygon by using the mouse (if the draggable property is set to true). google.maps.Polygon.moveTo() is a Google Maps extension augmenting that functionality by allowing one to programmatically move a google.maps.Polygon on the map without any user/mouse interaction. The script works with both geodesic (polygons that follow the curvature of the earth) and non-geodesic (straight) polygons.

Installation

How to use

See the example. Basically just call myPolygon.moveTo(new google.maps.LatLng(lat, lng)) to move the Polygon to the new Latitude/Longitude.

Notes / Bugs

License

google.maps.Polygon.moveTo() is released under the MIT public license. See the enclosed LICENSE for details.