从谷歌地图API隐藏本地列表 [英] hide local listings from google maps api
问题描述
使用Google地图API显示内容时,Google已开始将当地餐馆/酒店添加到地图中。
我怎么能隐藏它们出现。我查看了使用地图的网站上的相同位置(如yelp),并成功隐藏了当地的酒店/餐馆。
我一直在寻找图层/覆盖图,但无法弄清楚我是如何去除这种默认行为的。
表示3.6介绍业务图标默认情况下。因此,设置v = 3.5作为参数将隐藏业务图标。
赏金
是否有隐藏商业信息没有粘在api的旧版本上?
您可以通过正确设置地图样式来设置它们不可见。请参阅
http ://code.google.com/apis/maps/documentation/javascript/styling.html
和
这样应该可以做到这一点(尽管不是测试):
var noPoi = [
{
featureType:poi,
stylers:[
{visibility:off}
]
}
];
map.setOptions({styles:noPoi});
When using google maps api to display something google has started adding local restaurants/hotels into the map. How can I hide them from appearing. I checked the same locations on sites that use maps (like yelp) and they successfully hide the local hotels/restaurants. I've been looking for layers/overlays but can't figure out how I remove this default behavior.
example These things are appearing on my maps. is it possible to hide these bubbles and names?
edit https://developers.google.com/maps/documentation/javascript/releases#36 says that 3.6 introduces business icons on by default. So setting v=3.5 as a parameter will hide the "Business icons".
bounty Is there a way of hiding the business messages without sticking with an older version of the api?
you can set them invisible by setting the map style properly. See
http://code.google.com/apis/maps/documentation/javascript/styling.html
and
sth like that should do the trick (though not tested):
var noPoi = [
{
featureType: "poi",
stylers: [
{ visibility: "off" }
]
}
];
map.setOptions({styles: noPoi});
这篇关于从谷歌地图API隐藏本地列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!