Draw polygon using mouse on google maps
Posted
by Kunal
on Stack Overflow
See other posts from Stack Overflow
or by Kunal
Published on 2010-02-24T11:49:48Z
Indexed on
2010/06/16
2:12 UTC
Read the original article
Hit count: 490
JavaScript
|google-maps
I need to draw polygon using mouse and mark a particular area on google maps. The purpose is to mark an area on google maps and then showing hotels and attractions on that area. The user will mark the hotels on google map while creating them so the db will have their latitude and longitudes.
How can I draw the polygon and fill it with a color as background to mark the area in Google Maps? I have read the API Manual “how to draw polygons?” basically you would need to mark multiple points and then combine them into a polygon. But I will need to do this using mouse drag, just like drawing a shape. Kindly help me out how to achieve this.
Thanks in advance.
© Stack Overflow or respective owner