我目前正在将应用程序从V7迁移到V8,而我在此处所做的就是隐藏航路点和航点。我只是使用自定义图标图钉来标记路线上的开始/结束/通过点。
var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
credentials: bingMapCredentials,
showDashboard: false
});
var directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);
// Specify handlers for the 2 possible outcomes of the route calculation
Microsoft.Maps.Events.addHandler(directionsManager, 'directionsError', displayError);
Microsoft.Maps.Events.addHandler(directionsManager, 'directionsUpdated', processSuccess);
directionsManager.setRenderOptions({
waypointPushpinOptions: { visible: false },
viapointPushpinOptions: { visible: false },
autoUpdateMapView: false
});
我无法在documentation for setRenderOptions(DirectionsRenderOptions Object)中找到waypointPushpinOptions或viapointPushpinOptions。有没有办法隐藏waypointPushpins或viapointPushpins?
还会显示文字,其中包含图钉旁边的航点/经度点的经度和纬度。有没有办法隐藏这个文本?
答案 0 :(得分:0)
您无法在文档中找到这些内容,因为它们目前不受支持。路由样式的自定义刚刚被添加到V8的实验分支中。以下选项可用于自定义路径呈现:waypointPushpinOptions,firstWaypointPushpinOptions,lastWaypointPushpinOptions,drivingPolylineOptions,walkingPolylineOptions,transitPolylineOptions