关闭本地商家标记的信息窗口 [英] Close InfoWindow for local business marker

查看:18
本文介绍了关闭本地商家标记的信息窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 API v3 的新谷歌地图应用程序.在它上面我有一些带有信息窗口的自定义标记.我使用一个全局变量来确保在任何时候只打开一个信息窗口 - 一切都应该如此.

I have a new google map app using v3 of the API. On it I have a few custom markers with info windows. I use a global variable to ensure only one info window opens at any one time - everything is as it should be.

然而,地图带有许多本地商业标记,就像这张地图上的标记一样 (http://goo.gl/maps/M6m3),所有这些都打开自己的信息窗口.如果我点击其中一个,我的信息窗口不会关闭,如果我点击我的一个标记,内置的信息窗口也不会关闭 - 保持多个窗口打开.

However the map comes with many local business markers, just like the ones all over this map (http://goo.gl/maps/M6m3), all of which open their own infowindows. If I click on one of these my infowindow doesn't get closed, and if I click on one of my markers, the built in infowindow also doesn't close - leaving multiple windows open.

这能解决吗?

推荐答案

听起来您希望地图上的兴趣点"(AKA POI) 不可点击(或能够捕捉对它们的点击).

Sounds like you want the "Points of Interest" (AKA POI) on the map to not be clickable (or to be able to capture the click on them).

这在问题跟踪器中作为 FR 进行跟踪 并且最近 使用新属性 实现MapOptions

This was tracked as an FR in the issue tracker and was recently implemented using a new property clickableIcons in MapOptions

如果您将其设置为 false,则 POI 功能将不再可点击.您还可以使用 Map 对象上的 get/setClickableIcons 方法来动态更改此设置.

If you set it to false, POI features will no longer be clickable. You can also use the get/setClickableIcons methods on the Map object to change this dynamically.

处理它们的另一种方法是从地图中删除 POI(使用样式化地图),如果您不想在单击它们时打开信息窗口.

One other way to deal with them is to remove POIs from the map (using styled maps), if you don't want to have the infowindow open when they are clicked.

此处(如何删除地图上的某些位置) 是关于 v3 API 组关于使用样式化地图删除它们的一次讨论.

Here (How to remove certain places on a map ) is one discussion on the v3 API group about using styled maps to remove them.

还有 此处(禁用 POI 的 InfoWindows - 找到解决方法) 是另一个.

至少现在这样做不会花费更多(样式贴图曾经比普通贴图贵).

At least now it doesn't cost more to do that (styled maps used to be more expensive than normal maps).

这篇关于关闭本地商家标记的信息窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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