从新版Google地图中的嵌入式地图中删除信息窗口 [英] Removing the info window from an embedded map in the new Google Maps

查看:161
本文介绍了从新版Google地图中的嵌入式地图中删除信息窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几年,很容易从嵌入式Google地图中移除信息窗口。只需在查询字符串中添加 iwloc = near 即可。



在过去的几周里,Google已经迁移到NEW嵌入查询字符串格式,以配合他们的新地图产品。



有人知道如何用新的查询字符串隐藏信息气泡吗?我确实想保留标记图标(被信息窗口遮住)。我试图在查询字符串的其余部分之前包括 iwloc = near ,但是没有做任何事情。我没有在新的Embedded Map构建器上看到任何选项。

 < iframe 
src = https://www.google.com/maps/embed?iwloc=near&pb=!1m20!1m8!1m3!1d3246.3028987305834!2d-97.52973594999999!3d35.5462208!3m2!1i1024!2i768!4f13.1!4m9 !1I0!3E6!4m0!4M5!1s0x87b21a2b843c4d5f%3A0xd6deac9724fb9935!2s7316 + N +西+大道%2C +俄克拉荷马城+%2C + OK + 73116!3平方米!1d35.5462208!2D-97.5297267!5e0!3平方米!1sen!2sus !4v13942175576​​79
width =420
height =200
frameborder =0
style =border:0>
< / iframe>

以下是输出内容。请注意,我希望删除的信息窗口以红色接界。



解决方案

看起来他们已经彻底改变了嵌入式地图API作品...



新文档,看起来您可以通过在查看模式而不是放置模式中提出请求来清除泡泡。然而,这也不会产生任何标记。



关于place模式支持哪些选项没有太多的说法,但是您可以尝试将URL更新为新的地方端点,然后尝试一些遗留选项。



更新

我自己使用新的 google.com/maps/embed/v1/place/...端点对其进行了测试,如果您添加& iwloc 即可。实际上,它会抛出关于不支持的参数的错误。



不幸的是,新的API似乎只支持这些参数:


以下可选参数可用于上面列出的任何地图
模式。



中心定义地图视图的中心。它接受
逗号分隔的经纬度值(例如
37.4218,-122.0840)或地名或地址字符串(如Champ + de + Mars,Paris,France)。 p>

缩放设置地图的初始缩放级别。接受的值范围从0(全世界)到21(个别建筑物)为
。上限
可以根据所选位置的地图数据而有所不同。


maptype 可以是路线图(默认)或卫星,并定义
要加载的地图图块的类型。



语言定义用于UI元素的语言和在地图图块上显示标签的
。请注意,此参数仅对某些国家/地区磁贴支持
;如果请求的特定语言
不支持拼贴集,则将使用该
拼贴集的默认语言。默认情况下,访问者将以自己的
语言看到地图。



地区定义要显示的相应边框和标签在
地理政治敏感性。接受指定为
双字符ccTLD(顶级域名)值的地区代码。


抱歉坏消息的持有者。

In years past, it was easy to remove the info window from an embedded Google Maps. Just add iwloc=near in the query string.

In the past few weeks, Google has migrated to a NEW embed query string format, to coincide with their new Maps product.

Does anybody know how to hide the info bubble with the new query string? I do want to keep the marker icon (obstructed by the info window). I tried including iwloc=near before the rest of the query string, but that did nothing. I don't see any option on the new Embedded Map builder, either.

<iframe 
src="https://www.google.com/maps/embed?iwloc=near&pb=!1m20!1m8!1m3!1d3246.3028987305834!2d-97.52973594999999!3d35.5462208!3m2!1i1024!2i768!4f13.1!4m9!1i0!3e6!4m0!4m5!1s0x87b21a2b843c4d5f%3A0xd6deac9724fb9935!2s7316+N+Western+Ave%2C+Oklahoma+City%2C+OK+73116!3m2!1d35.5462208!2d-97.5297267!5e0!3m2!1sen!2sus!4v1394217557679" 
width="420" 
height="200" 
frameborder="0" 
style="border:0">
</iframe>

Here is what is output. Note the info window, bordered in red, that I wish to remove.

解决方案

It looks like they've overhauled the way the embedded maps api works...

From the new docs, it looks like you can definitely remove the bubble by making request in "view mode" instead of "place mode". However this will result in no marker either.

It doesn't have much to say on what options are supported for place mode, but you might try updating your URL to the new place endpoint and then experimenting with some of the legacy options.

Update

I tested it myself using the new google.com/maps/embed/v1/place/... endpoint and it doesn't work if you add &iwloc to that. In fact, it will throw an error about the unsupported parameter.

Unfortunately, it appears that the new API only supports these parameters:

The following optional parameters can be used with any of the map modes listed above.

center defines the center of the map view. It accepts either a comma-separated latitude and longitude value (such as 37.4218,-122.0840) or a place name or address string (such as Champ+de+Mars,Paris,France).

zoom sets the initial zoom level of the map. Accepted values range from 0 (the whole world) to 21 (individual buildings). The upper limit can vary depending on the map data available at the selected location.

maptype can be either roadmap (the default) or satellite, and defines the type of map tiles to load.

language defines the language to use for UI elements and for the display of labels on map tiles. Note that this parameter is only supported for some country tiles; if the specific language requested is not supported for the tile set, then the default language for that tileset will be used. By default, visitors will see a map in their own language.

region defines the appropriate borders and labels to display, based on geo-political sensitivities. Accepts a region code specified as a two-character ccTLD (top-level domain) value.

Sorry to be the bearer of bad news.

这篇关于从新版Google地图中的嵌入式地图中删除信息窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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