Javascript 使用自定义位置扩展层避免指定区域
在此贴图中,可以使用边界框数组作为参数来避免特定区域,如下所示:Javascript 使用自定义位置扩展层避免指定区域,javascript,here-api,Javascript,Here Api,在此贴图中,可以使用边界框数组作为参数来避免特定区域,如下所示: function calculateRoute(platform) { var router = platform.getEnterpriseRoutingService(), parameters = { waypoint0: '50.0522,8.2180', waypoint1: '50.0957,8.5280', mode: 'fastest;truck', av
function calculateRoute(platform) {
var router = platform.getEnterpriseRoutingService(),
parameters = {
waypoint0: '50.0522,8.2180',
waypoint1: '50.0957,8.5280',
mode: 'fastest;truck',
avoidareas: '50.1062,8.2811;50.0180,8.4253'};
router.calculateRoute(parameters,
function (result) {
alert(result);
}, function (error) {
alert(error);
});
}
您可以在以下文档中找到此代码:
我正试图找到将避开区域指定为图层的方法,但在文档中没有找到任何内容。有人知道这是否可能吗
注意:可以使用自定义位置扩展在地图中上载图层,然后可以将图层作为id检索。自定义路由扩展是您需要的developer.here.com/documentation/custom-routing-extension/topics/quick-start-block-A-road.html。您可以上载覆盖地图以避开特定区域。快乐编码 avoidareas油田的用途不一样吗。它应该是一个边界框数组。我在所有文档中都找到了,但我没有找到,所以我想它不存在。你没有找到什么?回避区域作为层id参数,正如你所说:是的,这正是我要找的。非常感谢。