是否可以将 Tilestache 与 HERE 地图一起使用 Javascript API?
Is it possible to use Tilestache with HERE maps Javascript API?
我浏览 HERE 地图 API 以获得 Javascript 文档有一段时间了,但没有发现是否可以在 HERE 地图 API 中使用来自 Tilestache 的自定义图块的信息Javascript.
我想问比我更有经验的 API 的问题:是否可以在 HERE 地图 API 中为 Javascript 使用自定义图块?
非常感谢!
可以对此处的地图使用自定义地图图块。您可以在此处找到如何操作的示例:
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);
我浏览 HERE 地图 API 以获得 Javascript 文档有一段时间了,但没有发现是否可以在 HERE 地图 API 中使用来自 Tilestache 的自定义图块的信息Javascript.
我想问比我更有经验的 API 的问题:是否可以在 HERE 地图 API 中为 Javascript 使用自定义图块?
非常感谢!
可以对此处的地图使用自定义地图图块。您可以在此处找到如何操作的示例:
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);