Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put the marker with google maps query string

I can share a location with google maps providing the lat and lon parameters. For example;

http://maps.google.com/maps?ll=40.01696,32.33076&z=17

With the "ll" parameter i can center the map there. Is there a way to put the marker to the position specified?

like image 918
syloc Avatar asked Feb 20 '12 20:02

syloc


People also ask

How do I find the marker ID on Google Maps?

getId() function to retrieve marker id.

How do I link to an address from Google Maps in HTML?

Embed a map or directionsClick Share or embed map. Click Embed map. Copy the text in the box. Paste it into the HTML of your website or blog.


1 Answers

If you use 'q' on its own as in:

http://maps.google.com/maps?q=40.01696,32.33076&z=17

then you will get a green pointer at the point of the coordinates provided but you'll also get an unwanted additional red marker for a nearby point of interest, which doesn't look good and can be confusing for the viewer.

Best option is to use 'q=loc:' as in:

http://maps.google.com/maps?q=loc:40.01696,32.33076&z=17

This will only display a single red marker for the coordinates provided and centres the map on that point.

like image 130
Dan Solo Avatar answered Sep 21 '22 07:09

Dan Solo