【问题标题】:How to make Google Maps in black & white如何制作黑白的谷歌地图
【发布时间】:2013-02-14 15:07:54
【问题描述】:

我正在尝试制作黑白的谷歌地图,但我找不到方法。但是我发现这个网站已经实现了它:http://www.creuna.com/contact/find-us/

有什么线索吗?

【问题讨论】:

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


    【解决方案1】:

    我以前没用过,但 Google 的地图 API 似乎有一个样式部分,可让您真正自定义地图的外观:

    https://developers.google.com/maps/documentation/javascript/styling

    包含了很多应该能够提供帮助的示例。

    【讨论】:

    • 是的,但你必须使用它才能让它做你想做的事情。
    【解决方案2】:

    Styled Map Wizard 这很接近:

     [ { 
      "featureType": "water", 
      "stylers": [ { 
        "color": "#ffffff" } 
        ] 
      },{ 
      "featureType": "landscape", 
      "elementType": "geometry", 
      "stylers": [ { 
        "color": "#000000" } 
       ] 
      },{ 
      "featureType": "administrative", 
      "elementType": "labels.text.fill", 
      "stylers": [ { 
        "color": "#ffffff" } 
        ] 
      },{ 
      "featureType": "administrative", 
      "elementType": "labels.text.stroke", 
      "stylers": [ { 
        "visibility": "simplified" } 
        ] 
      },{ 
      "featureType": "road", 
      "elementType": "geometry", 
      "stylers": [ { 
        "visibility": "off" } 
        ] 
      },{ 
      "featureType": "poi", 
      "elementType": "geometry.fill", 
      "stylers": [ { 
        "color": "#000000" }, { 
        "visibility": "simplified" } 
        ] 
      },{ 
      "featureType": "administrative.province", 
      "stylers": [ { 
        "visibility": "off" } 
        ] 
      },{ 
      "featureType": "road", 
      "elementType": "geometry.stroke", 
      "stylers": [ { 
        "color": "#ffffff" }, { 
        "weight": 2 }, { 
        "visibility": "off" } 
        ] 
      },{ 
      "featureType": "administrative.locality", 
      "stylers": [ { "visibility": "off" } 
        ] 
      },{ 
      "featureType": "road", 
      "elementType": "labels", 
      "stylers": [ { 
        "visibility": "off" } 
        ] 
      },{ 
      "featureType": "poi", 
      "stylers": [ { 
        "visibility": "off" } 
        ] 
      },{ 
      "featureType": "transit", 
      "stylers": [ { 
        "visibility": "off" } 
        ] 
      },{ 
      "featureType": "administrative.neighborhood", 
      "stylers": [ { 
        "visibility": "off" } 
        ] 
      } 
    ]
    

    Working Example/proof of concept (using above style) 从文档中的this exmaple 开始,显然需要一些调整。仅供参考 - 您链接到的示例是来自 Stamen Maps 的自定义地图类型。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-01
      • 1970-01-01
      • 2014-02-04
      • 2017-04-26
      • 1970-01-01
      相关资源
      最近更新 更多