Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedding google maps - how to eliminate unwanted marker?

Tags:

google-maps

If I embed a google map with the following (this is the src attribute on an iframe):

http://maps.google.com/maps?q=37.421770,-122.08448&output=embed

There are two markers on the map - one with the lat/long I passed in (the green arrow), and a second regular marker.

Is there a way to eliminate the 2nd marker?

like image 260
chris Avatar asked Feb 26 '10 19:02

chris


1 Answers

It looks like you're sending your coords in the query field.

That would seem to mean that you're searching Google Maps for something near those coords. It seems to have found one thing and is giving you the search result alongside your queried coords.

Removing the &embed parameter shows that this is indeed the case:

http://maps.google.com/maps?q=37.421770,-122.08448

I'd suggest reading Google's static maps API instructions a bit more carefully and constructing a URL that simply displays a marker rather than querying on a point. Like this:

http://maps.google.com/maps/api/staticmap?zoom=14&size=512x512&maptype=roadmap&markers=color:blue|label:|37.421770,-122.08448&sensor=false

Good luck!

like image 128
Jason Kester Avatar answered Jan 01 '23 00:01

Jason Kester