2017-02-28 68 views
0

我一直在瀏覽HERE地圖API for Javascript文檔了一段時間,並且發現沒有信息可以使用Tilestache中的自定義貼圖在HERE Maps API for Javascript中使用。是否可以使用Tilestache和HERE maps Javascript API?

我的問題是你對這個API比我更有經驗:你可以在HERE Maps API for Javascript中使用自定義切片嗎?

非常感謝提前!

回答

1

在這裏可以使用自定義地圖貼圖。你可以找到如何在這裏做一個例子:

https://developer.here.com/api-explorer/maps-js/v3.0/infoBubbles/custom-tile-overlay

我建議您查看完整的例子,但在任何情況下,關鍵點是這些:

1)創建瓷磚供應商,並指定URL格式

var tileProvider = new H.map.provider.ImageTileProvider({ 
 
    // We have tiles only for zoom levels 12â€「15, 
 
    // so on all other zoom levels only base map will be visible 
 
    min: 12, 
 
    max: 15, 
 
    getURL: function (column, row, zoom) { 
 
     ... omitted 
 
     
 
     // The Old Berlin Map Tiler follows the TMS URL specification. 
 
     // By specification, tiles should be accessible in the following format: 
 
     // http://server_address/zoom_level/x/y.png 
 
     return 'tiles/'+ zoom+ '/'+ row + '/'+ column+ '.png'; 
 
     } 
 
    } 
 
    });

2)創建的層,並添加我噸至地圖

// Now let's create a layer that will consume tiles from our provider 
 
    var overlayLayer = new H.map.layer.TileLayer(tileProvider, { 
 
    // Let's make it semi-transparent 
 
    opacity: 0.5 
 
    }); 
 

 
    // Finally add our layer containing old Berlin to a map 
 
    map.addLayer(overlayLayer);

+0

很有前途,我現在要試試這個。非常感謝您的回答!我在原始問題中忘記了是否有一種方法可以用我的自定義切片以某種方式使用UTF Grid? – Tamas

+0

不能幫助你,我不知道:/ – SirBif

+0

太棒了!它像一個魅力工作,謝謝你! – Tamas

相關問題