Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add "Search Area" outline onto google maps result

Last year, Google added search area outlines to its offerings as reported in many places, and visible on Google maps itself. For example here, and reported here and here.

To be explicit, this is when google adds an outline relating to the search query. If you were to search for a town, a post code, or a zip code, Google will highlight this region of the map. Example:

90210 Search on Google Maps

This was apparently not available via the API, and only through Google's own web properties.

Recently, I noticed some other domains using this functionality, for example on Twitter.

Is there a seperate API Twitter and other large organisations are using? Has this functionality been added, but is as yet undocumented? Or have I simply missed the announcement and can't find any docs?

like image 373
dazbradbury Avatar asked Mar 14 '12 16:03

dazbradbury


People also ask

How do I create a custom border on Google Maps?

In the upper-left, next to the search bar, you'll see three little horizontal lines representing the menu. Click there. Select “Your places,” then hit the “MAPS” tab. At the bottom, you should now see “CREATE MAP.” Once you click on it, you'll get a box in which you can start putting your custom information.

How do you add a structure to Google Maps?

Add a place Open or create a map. A map can have up to 10,000 lines, shapes, or places. Select a layer and click where to put the place. A layer can have 2,000 lines, shapes, or places.


1 Answers

As there is no yet solution offered by the Maps API and manually filling in coordinates is nobody's business, here's a gem of an alternative. Found this answer on the GIS website--absolute lifesaver (would've saved jurihandl a LOT of minutes drawing Calgary, above ;D):

You can get polygon coordinates in json for using with googlemaps using openstreetmap. Go to http://nominatim.openstreetmap.org/. Search a place like "San Francisco, CA"

Click on "Details"

Look for OSM ID and copy it (control+c), example: 2018776

Paste the ID http://polygons.openstreetmap.fr/index.py and download the JSON file

Source: GIS

like image 58
Govind Rai Avatar answered Sep 28 '22 20:09

Govind Rai