你如何删除谷歌地图V3上的床图标? [英] How do you remove the bed icons on Google Maps V3?

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

问题描述

我不想在嵌入到我网站的地图上显示这些图标: b
$ b



有谁知道API调用的内容是。我浏览了 https://developers.google.com/maps/documentation/javascript/参考资料,并且没有任何运气。 这些是Googles POI的。不确定子类型(请参阅 https://developers.google.com/maps/documentation/javascript / reference#MapTypeStyleFeatureType ),但您可以禁用所有类型的POI,使用类似这样的内容:

  var myStyles = [
{
featureType:poi,
elementType:labels,
stylers:[
{visibility:off}
]
}
];

var myOptions = {
zoom:10,
center:new google.maps.LatLng(54.42838,-2.9623),
mapTypeId:google.maps.MapTypeId .ROADMAP,
款式:myStyles
};

map = new google.maps.Map(document.getElementById(map_canvas),myOptions);

事实上,病床属于'poi.business '子类型,如果您使用以下功能,还可以防止商店显示等内容:

  featureType:poi.business,


I want to not show these icons on the maps embedded in my website:-

Does anyone know what the API call is. I have looked through https://developers.google.com/maps/documentation/javascript/reference and have had no luck at all.

解决方案

These are Googles POI's. Not sure of the sub-type (see https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyleFeatureType), but you can disable all types of POIs from appearing using something like this:

var myStyles =[
    {
        featureType: "poi",
        elementType: "labels",
        stylers: [
              { visibility: "off" }
        ]
    }
];

var myOptions = {
    zoom: 10,
    center: new google.maps.LatLng(54.42838,-2.9623),
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    styles: myStyles 
};

map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

In fact the beds fall under the 'poi.business' sub-type, which will also prevent things like shops showing up, if you use:

 featureType: "poi.business",

这篇关于你如何删除谷歌地图V3上的床图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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