开发者

Embedding google maps - how to eliminate unwanted marker?

开发者 https://www.devze.com 2022-12-21 04:28 出处:网络
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=embe开发者_C百科d

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=embe开发者_C百科d

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?


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!


I added loc: before the query, and it works now perfectly: http://maps.google.com/maps?q=loc:37.421770,-122.08448&output=embed


No, only if you use google maps API instead iframes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号