嵌入谷歌地图 - 如何消除不需要的标记? [英] Embedding google maps - how to eliminate unwanted marker?

查看:401
本文介绍了嵌入谷歌地图 - 如何消除不需要的标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用以下内容嵌入Google地图(这是iframe上的src属性):

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



地图上有两个标记 - 一个是经过的纬度/长度(绿色箭头),另一个是常规标记。



有没有办法消除第二个标记?

解决方案

它看起来像你在查询字段中发送您的坐标。

这似乎意味着您要在Google地图上搜索这些坐标附近的东西。它似乎找到了一件事,并将搜索结果与您查询的坐标一起给您。



删除& embed参数表明确实如此:

p>

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



我建议阅读谷歌的静态地图API说明更仔细一点,并构建一个URL,只显示标记而不是查询某个点。像这样:



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

祝您好运!


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?

解决方案

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!

这篇关于嵌入谷歌地图 - 如何消除不需要的标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆