How does Google Maps draw the polygon automatically when we type the name of a neighborhood?
Below I did a search on the maps for the neighborhood
How does Google Maps draw the polygon automatically when we type the name of a neighborhood?
Below I did a search on the maps for the neighborhood
To create a polygon we need to know the area to be delimited we need coordinates; if we have the coordinates that will define the contour of the polygon, the work becomes easier; in our case since we do not have the coordinates, we create the perimeter of the area to be delimited and then we will get the coordinates. To learn how to create a file for displaying maps with the V3 Google Maps API, visit the article Creating a polygon map with the Maps API V3.
Withthelinedrawingtoolselectedsimplydrawthedesiredpolygon.Onetip,asoftentheareaofthepolygonisextensiveandweneedtomovemelomapandzoom,themouseclickcannotbeusedtomovethemap,becauseeachclickwiththemousecorrespondstoapointofthepolygontobemarked;sousethemouseonlytomarkthepointsofthepolygon,andscrooltosetthezoom,movingbythemapmustbedoneonlybythearrowkeys.
Thislinkshowstheprocedurecompletely: link