Drag (move) a polygon using Google Maps v3

前端 未结 5 913
清歌不尽
清歌不尽 2021-01-02 15:49

The Google Maps API for a Polygon does not offer a drag method.

What would be an efficient way of implementing such a feature (i.e., sufficiently optimised so that i

5条回答
  •  猫巷女王i
    2021-01-02 16:43

    Since version 3.11 (dated Jan 22, 2013) it's possible to just set the draggable property onto the google.maps.Polygon instance; see this example.

    If you want to programmatically move a polygon, you'll need a custom Google Maps Extension which I wrote, as the API does not provide such a method.

提交回复
热议问题