2017-02-28 66 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

相关问题