Google Maps API, get boundary of search results - google-maps

How cloud I export coords of red polygon (e.g. boundaries of small administrative areas) from Google Maps API (JavaScript)?

You have to do this manually. This link returns a detail of a city. Like, if you search 'New York' the boundary of New York will be shown, like this:
Now if you click the detail button, you will get an OSM id which is '175905' for New York.
Now you have to go to this link and paste this OSM in the Id of relation text box and submit. You will get polyline informations in many formats.

Related

Google maps embed API fallback coordinates

I have a website that contains a database of places, mostly stores and small businesses, and i want to add a google map for every business on the site. I have a name and coordinates for each business, but not all of them are listed on google maps. If i make a Google Maps Embed API map like this:
https://www.google.com/maps/embed/v1/place?key=APIKEY&q=Place name
I will get a marker on that place, but if that place is not found, is it possible to make it put a marker on the coordinates provided?
I know i can just use the coordinates without any name, but in case the place is listed on google maps, querying its name instead of coordinates will display details about the place
Yes you can still place a marker as long as you have the lat and long.
You can add your business to Google Map over here.

Can I get Google maps to ignore part of a search?

I have a website which shows scheduled upcoming bike rides using Google Calendar. The location field automatically links to Google maps, but some of the information can make the Google maps search fail, and there's no way to turn off the map link.
Example: The upcoming ride has in the location field "Seven Hills Station, North side of the train tracks, 9am sharp". When you click on the map link, it just brings up a map of the US. If you search for "Seven Hills Station", it comes up with the train station in Seven Hills NSW, which is what we want. So if there was an operator that made the Google maps search ignore everything after "Hills" (like the question mark in URLs), I could keep displaying the calendar events in the same format and have working maps linked from it. Does anyone know of an operator that can make Google maps ignore part of a search?
Cheers,
Aston
I think you can use regex to delete everything after the ,
using the replace function, this is how you replace something in JS: str.replace(/,.*/g, "");
http://jsfiddle.net/gvzpe9h9/

How do I specify a marker in a url using a name and lat/long for the new Google Maps?

I tried generating a url as per the answer by Everton Cunha here: What parameters should I use in a Google Maps URL to go to a lat-lon? i.e.
http://maps.google.com/?q=MY%20LOCATION#lat,long
This works for me in Google Maps in what is now called "Classic Mode", but in the new Google Maps, it places a marker, displays the lat/long next to it, and the marker does not display any information when I click on it, and the nearest address appears in the search box. I need a url that places the marker at the specified lat/long, and also includes some text describing what the marker is.

Google MAPS: colour active countries AND add markers

I'm building a travel social network website and I need to create a custom Google Maps based map.
In their profile users can:
list the countries they've visited;
for each country they can specify the cities they visited.
That means that on the same map I need to:
colour the countries the user has visited;
for each (now coloured) country he has visited, add a marker on the cities he went to.
As far as I've read, I should use Google Charts API to get the countries coloured.
But I need an actual Google Map....any ideas?
Thanks in advance,
E.
Use the Google Maps API v3. See the documentation and search this site for how to:
add markers
create country polygons

google maps help

First, I'm trying this through Google (not using API). Want to see if it's possible without API first.
I have a saved map in google which has some points of interest. (ex: national parks)
However, when I search for directions (ex: from: denver, co to: chicago, il) the directions appear, but my saved map (POI's) disappear.
Has or does anyone know how I can modify the URL to have these 2 overlay?
Thanks!
My workflow is:
-Go to Google maps (sign in if necessary)
-Go to My Places
-Select the map you're interested in,
-From here, click on Get directions, type A an B then enter
-Here, you have your directions but your map is lost, but...
-If you click on My Places and your map again, bingo!
You can save directions to the 'My Maps' feature of Google Maps. Once you search for directions, there is a link at the bottom of the direction sidebar titled 'Save to My Maps'. After the directions are saved, you can add custom features to the map in the 'My Maps' editor.