如何使用H.ui.MapSettingsControlselectPOI地图?
How to select the POI map using the H.ui.MapSettingsControl?
我正在使用 HERE JS 库进行映射。我想在 MapSettingsControl 中添加一个选项到 select POI 地图,如 https://developer.here.com/documentation/map-tile/dev_guide/topics/example-poi-tile.html
所示
您似乎需要在磁贴请求中附加“&pois”才能获得此信息。
我已按照 中的示例在 MapSettingsControl 中创建新的 select 可用地图样式。
但是,您似乎只能select 地图样式名称而不能附加参数。具体来说,我看不到将 &pois 参数附加到磁贴请求以获取 POI 磁贴的方法。
有什么建议吗?
啊,我找到了答案,但是有点麻烦
var maptypes = platform.createDefaultLayers();
var poi = platform.createDefaultLayers({pois:true});
ui.removeControl("mapsettings");
// create custom one
var ms = new H.ui.MapSettingsControl( {
baseLayers : [ {
label:"Normal", layer: maptypes.vector.normal.map
},
{
label:"POI", layer: poi.raster.normal.map
},
],
layers : [{
label: "layer.traffic", layer: maptypes.vector.normal.traffic
},
{
label: "layer.incidents", layer: maptypes.vector.normal.trafficincidents
}
]
});
ui.addControl("customized",ms);
我正在使用 HERE JS 库进行映射。我想在 MapSettingsControl 中添加一个选项到 select POI 地图,如 https://developer.here.com/documentation/map-tile/dev_guide/topics/example-poi-tile.html
所示您似乎需要在磁贴请求中附加“&pois”才能获得此信息。
我已按照
但是,您似乎只能select 地图样式名称而不能附加参数。具体来说,我看不到将 &pois 参数附加到磁贴请求以获取 POI 磁贴的方法。
有什么建议吗?
啊,我找到了答案,但是有点麻烦
var maptypes = platform.createDefaultLayers();
var poi = platform.createDefaultLayers({pois:true});
ui.removeControl("mapsettings");
// create custom one
var ms = new H.ui.MapSettingsControl( {
baseLayers : [ {
label:"Normal", layer: maptypes.vector.normal.map
},
{
label:"POI", layer: poi.raster.normal.map
},
],
layers : [{
label: "layer.traffic", layer: maptypes.vector.normal.traffic
},
{
label: "layer.incidents", layer: maptypes.vector.normal.trafficincidents
}
]
});
ui.addControl("customized",ms);