UPDATE 2018.03.07: The issue requesting to have this in the core of Google Maps got marked as fixed … unfortunately I cannot find this change back in the documentation, so I’m not too sure if it’s actually fixed or not. Will keep tracking it.
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 — see example here). Unfortunately the API does not allow us to move that Polygon programatically.
google.maps.Polygon.moveTo() is a Google Maps extension enabling just that: it allows 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.
In the screenshot above, the red polygon is the original one, and the green one is the one that’s been moved using
google.maps.Polygon.moveTo(). The distortion is normal, due to the Mercator Projection
I don’t run ads on my blog nor do I do this for profit. A donation however would always put a smile on my face though. Thanks!
(*) The current stable version of Google Maps still is 3.10. For now (until 3.11 is the stable one), you can include the experimental 3.11 version by referencing