0

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

有什么线索吗?

4

2 回答 2

5

我以前没用过,但看起来 Google 的地图 API 有一个样式部分,可以让您真正自定义地图的外观和感觉:

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

有很多例子应该能够提供帮助。

于 2013-02-14T15:13:59.773 回答
1

查看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" } 
    ] 
  } 
]

从文档中的这个例子开始的工作示例/概念证明(使用上述样式)显然需要一些调整。仅供参考 - 您链接到的示例是Stamen Maps的自定义地图类型。

于 2013-02-14T15:42:19.043 回答