【问题标题】:hiding google map floor plans隐藏谷歌地图平面图
【发布时间】:2012-12-17 02:57:01
【问题描述】:

当使用 Google Map API v3 并使用样式化地图类型时,我无法隐藏放大时出现的平面图。有许多“MapTypeStyleFeatureType”选项,这些选项都不能帮助隐藏平面图.

https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyleFeatureType

API v3 文档似乎没有包含有关平面图的任何内容。为了清楚起见,这是一个平面图示例:

http://maps.googleapis.com/maps/api/staticmap?center=51.496643,-0.172192&zoom=18&format=png&sensor=false&size=640x480&maptype=roadmap&style=feature:administrative|visibility:off

任何帮助或指点将不胜感激。

谢谢, 乔恩。

【问题讨论】:

  • 嗨,我真的很喜欢这种情况,有没有办法实现这一点?你能分享这个场景的演示或代码吗?谢谢

标签: google-maps google-maps-api-3 google-maps-styled


【解决方案1】:

好的,经过更多的实验,这就是我解决的问题......在第一种样式中将所有颜色设置为灰色(或您希望平面图采用的任何颜色),然后重新着色您想要的所有颜色以下样式。这会导致平面图显示为单个颜色块。

var styles = [
        {
            featureType: "all",
            stylers: [
                { color: "#505050" }
            ]
        },
        {
            featureType: "road",
            elementType: "geometry",
            stylers: [
                { visibility: "simplified" },
                { color: '#505050' }
            ]
        },
        {
            featureType: "all",
            elementType: "labels",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "administrative",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "transit",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "poi",
            stylers: [
                { visibility: "off" }
            ]
        },
        {
            featureType: "landscape",
            stylers: [
                { color: '#FF0000' }
            ]
        },
        {
            featureType: "landscape.man_made",
            stylers: [
                { color: '#393939' }
            ]
        },
        {
            featureType: "landscape.natural",
            stylers: [
                { color: '#393939' }
            ]
        },
        {
            featureType: "water",
            stylers: [
                { color: '#252525' }
            ]
        }
    ];

【讨论】:

    【解决方案2】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-28
    • 2013-04-28
    • 2021-01-31
    • 1970-01-01
    相关资源
    最近更新 更多