How does Maps draw polygon automatically when typing the neighborhood name?

Asked

Viewed 416 times

2

How Google Maps draws the polygon automatically when we type in a neighborhood’s name?

Below I did a search on maps around the neighborhood Colinas da Anhanguera, Santana de Parnaíba - SP, the same generated this polygon automatically.

Bairro Pesquisado: Colinas da Anhanguera

  • 1

    It looks vaguely like a horse’s head ("I will make a proposal that he cannot refuse"...). And the map of São Paulo looks like a giraffe...

1 answer

2


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 as we do not have the coordinates we will 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 Google Maps V3 API, visit the article Creating a polygon map with the Google Maps V3 API.

inserir a descrição da imagem aqui

With the line drawing tool selected just draw the desired polygon. A tip, as often the area of the polygon is extensive and we need to move meMelo map and zoom, the mouse click can not be used to move the map, because each mouse click corresponds to a point of the polygon to be marked; therefore, use the mouse only to mark the points of the polygon, and the scrool to set the zoom, the movement by the map should be done only by the arrow keys.

inserir a descrição da imagem aqui

This link shows the entire procedure: http://www.sutel.com.br/blog/index.php/en/programacao/64-criando-um-poligono-area-delimitada-no-google-maps

  • 2

    Got it, very good article, my other question is how Google Maps does polygon automatically? Ex: Search some neighborhood on Maps and see the polygon generated.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.