2012-02-25 111 views
10

我想得到一張地圖(我只需要一張圖片),它具有道路網絡 ,但沒有標籤(地圖上的文本)。我試圖從谷歌API獲得這樣的地圖,並認爲"element:geometry" 的作品。如何獲得沒有標籤的地圖?

但是,例如,this link仍然充滿文本。

如何獲取沒有文字標籤的道路網絡地圖(靜態圖片確定)?
任何供應商都可以,例如谷歌,雅虎,Mapquest ...

+0

這些解決方案的 '路線圖' 和 '衛星' 工作。我正在嘗試獲取沒有街道名稱的StreetView。我一直在閱讀API文檔,但無法找到如何在街景上刪除標籤。任何線索? – 2017-11-05 18:05:25

回答

34

使用這種樣式:

style=feature:all|element:labels|visibility:off 

它會隱藏所有功能的所有標籤。

http://maps.google.com/maps/api/staticmap?sensor=false&size=512x512&center=Brooklyn&zoom=12&style=feature:all|element:labels|visibility:off

+0

http://maps.googleapis.com/maps/api/staticmap?center=28.459033,22.060547&zoom= 2&format = png&sensor = false&size = 640x480&maptype = roadmap&style = feature:administrative | weight:0.1 | invert_lightness:true | visibility:off&style = feature:water | element:labels.text | visibility:off&style = feature:landscape.natural | visibility:on – 2015-03-18 10:14:21

3

This is the documentation地圖樣式的JavaScript API。還有一個Styled Map Wizard,讓你玩風格,以得到你想要的。

+0

是的,我看到那個文件。他們說「元素:幾何只選擇該特徵的幾何元素。 元素:標籤只選擇與該特徵相關的文本標籤。」我只想要幾何元素(道路網絡)並避免文本標籤。所以我使用「元素:幾何」。但它不會刪除地圖上的文字。 – Aaron 2012-02-25 17:59:47

+0

Dr. Molle有答案 – 2012-02-25 23:33:40

+0

現在可在此處找到樣式嚮導:https://mapstyle.withgoogle.com/ – smashuu 2017-08-07 18:30:32

0

通過「我只需要一張照片:」我想你不需要訪問API,谷歌公司開發者仍然沒有從舊映射到應用的所有功能的機會新設計。 但是你仍然可以去https://maps.google.com/?output=classic

訪問它,你可以去設置和自定義「刻度標記關」等等......

4

我得到了一個更好的解決方案:

創建html文件並插入下面的代碼。

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Mapa GMR Norte</title> 
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> 
    <meta charset="utf-8"> 
    <style> 
     html, body { 
     height: 100%; 
     margin: 0; 
     padding: 0; 
     } 
     #map { 
     height: 100%; 
     } 
    </style> 
    </head> 
    <body> 
    <div id="map"></div> 
    <script> 
function initMap() { 
    var customMapType = new google.maps.StyledMapType([ 
     { 
     elementType: 'labels', 
     stylers: [{visibility: 'off'}] 
     } 
    ], { 
     name: 'Custom Style' 
    }); 
    var customMapTypeId = 'custom_style'; 

    var map = new google.maps.Map(document.getElementById('map'), { 
    zoom: 13, 
    center: {lat: 41.4416459, lng: -8.2911885}, // Brooklyn. 
    mapTypeControlOptions: { 
     mapTypeIds: [google.maps.MapTypeId.ROADMAP, customMapTypeId] 
    } 
    }); 

    map.mapTypes.set(customMapTypeId, customMapType); 
    map.setMapTypeId(customMapTypeId); 
} 

    </script> 
    <script src="https://maps.googleapis.com/maps/api/js?signed_in=true&callback=initMap" 
     async defer></script> 
    </body> 
</html> 

希望它有幫助! :)

0

Google地圖樣式化映射向導(以下鏈接)將允許您刪除標籤(並且還可以製作大量其他自定義項)。

https://mapstyle.withgoogle.com/

+0

該鏈接是Google地圖樣式映射向導。如果該鏈接不可用,那麼我的回答是無效的。 – nicolefurlan 2016-04-25 19:16:34

+0

答案中的鏈接已死 - *錯誤404(未找到)* – Pang 2017-02-03 02:32:34

+0

現在可在此找到樣式嚮導:https://mapstyle.withgoogle.com/ – smashuu 2017-08-07 18:28:53

相關問題