从谷歌地图 api 隐藏本地列表 [英] hide local listings from google maps api

查看:17
本文介绍了从谷歌地图 api 隐藏本地列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用谷歌地图 api 显示某些东西时,谷歌已开始将当地餐馆/酒店添加到地图中.我怎样才能隐藏它们不出现.我在使用地图的网站(如 yelp)上检查了相同的位置,他们成功地隐藏了当地的酒店/餐厅.我一直在寻找图层/叠加层,但不知道如何删除此默认行为.

说 3.6 默认情况下引入业务图标.因此,将 v=3.5 设置为参数将隐藏业务图标".

赏金有没有办法在不坚持使用旧版本的 api 的情况下隐藏业务消息?

解决方案

您可以通过正确设置地图样式来将它们设置为不可见.见

http://code.google.com/apis/maps/文档/javascript/styling.html

http://code.google.com/intl/pl/apis/maps/documentation/javascript/reference.html#MapTypeStyleFeatureType

这样的东西应该可以解决问题(虽然没有经过测试):

var noPoi = [{特征类型:poi",造型师:[{可见性:关闭"}]}];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

http://code.google.com/intl/pl/apis/maps/documentation/javascript/reference.html#MapTypeStyleFeatureType

sth like that should do the trick (though not tested):

var noPoi = [
{
    featureType: "poi",
    stylers: [
      { visibility: "off" }
    ]   
  }
];

map.setOptions({styles: noPoi});

这篇关于从谷歌地图 api 隐藏本地列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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