首页 > 解决方案 > MapQuest Route 不适用于欧洲的某些地点

问题描述

我有以下代码在 MapQuest 地图上绘制路线:

this.map = L.mapquest.map('map', {
   center: [48.3552767, -99.9995795],
   layers: L.mapquest.tileLayer('dark'),
   zoom: 2,
   zoomAnimation: false,
 });
   
const directions = L.mapquest.directions();
 
 directions.route({
   // these are not wokring
   // start: [47.372219,8.541973],
   // end: [52.18988,21.63049]

   // these are working
   start: [50.86766, 2.84919],
   end: [47.993594, 0.107319]
 }, (err, response) => {
   this.buildRouteLayers(layers, routeLayer, response, length);
 });

我观察到,我只面临包括瑞士波兰在内的路线的任何纬度/经度对都运行良好的问题。

以下是浏览器控制台上的错误:

Uncaught (in promise) 没有返回任何条件。此路线没有交通数据。

标签: mapquest

解决方案


原点 47.372219,8.541973 位于河流中。从可通航的道路开始这条路线有点太远了。


推荐阅读