微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

HERE Maps Javascript API 中未检测到道路

如何解决HERE Maps Javascript API 中未检测到道路

最近我一直在尝试通过西班牙的一条特定道路制作一些路线(屏幕截图和下面路线的链接),虽然我已经能够通过网络应用程序引导它通过它,但这是不可能的我使用 Javascript API 做同样的事情。 当我尝试在所需的道路上放置一个航点时,我收到此错误消息

norouteFound

{
    "_type":"ns2:RoutingServiceErrorType","type":"ApplicationError","subtype":"norouteFound","details":"Error is NGEO_ERROR_GRAPH_disCONNECTED_CHECK_OPTIONS","additionalData":[{"key":"error_code","value":"NGEO_ERROR_GRAPH_disCONNECTED_CHECK_OPTIONS"}],"MetaInfo":
    {
        "timestamp":"2021-02-04T14:43:16Z","mapVersion":"8.30.117.150","moduLeversion":"7.2.202105-1486","interfaceVersion":"2.6.76","availableMapVersion":["8.30.117.150"]
    }
}

我也尝试过取消路线限制,但没有成功。只希望有人遇到同样的问题

通过这里网络应用程序 here 的路线

解决方法

在您的 custom request 中,您已在 fastest;truck;tollroad:-3 上设置了交通方式,这意味着您正在寻找一条可以供卡车使用的路线。

与此同时,您链接的 HERE WeGo 示例正在计算汽车的路线。 如果我们从 mode=fastest;truck;tollroad:-3 切换到 mode=fastest;car;tollroad:-3,并保持所有其他参数不变,我们可以找到一条经过这些航点的路线:

回复

{
  "response": {
    "metaInfo": {
      "timestamp": "2021-02-08T15:08:38Z","mapVersion": "8.30.117.151","moduleVersion": "7.2.202105-8389","interfaceVersion": "2.6.76","availableMapVersion": [
        "8.30.117.151"
      ]
    },"route": [
      {
        "routeId": "ABUBCAAAAB4AAAB1AAAAlwAAANUBAAB42mO4ysjAxMYABDmulnW5ShfjGKCgT_6tKCODkzXD__8QgQ_7GZAAF4g45XH-JRMDS05mncyqbrjOWfNfiNYxOFng06ka_ESOkaF55dk6ndAyuM7N8c9FhTmcbPDpXFCY-JaRYXXvtboM60y4zq3zn4nmsuLXKbYwxwpo59ZrdROFUhE645-JvmDBr7O62z2VkeE80M6gA8kInfLPRDcw4tcp7Tx_OyOIwcgAphjYGHABw3UrapWYGBgMQBx-A0YFBgeGBwwMPAwMcxgUQDo5FLQYWRyC2gxUgLwvDDwODPxgjQkMzo4tfy4vvMEYkMCgwMVYI3aQEQBgWFlRrc9XUA","waypoint": [
          {
            "linkId": "-1238197473","mappedPosition": {
              "latitude": 43.3362329,"longitude": -2.4982456
            },"originalPosition": {
              "latitude": 43.33631,"longitude": -2.4979
            },"type": "stopOver","spot": 0.3538462,"sideOfStreet": "left","mappedRoadName": "Barrio Urrutia","label": "Barrio Urrutia - BI-2405","shapeIndex": 0,"source": "user"
          },{
            "linkId": "+724111030","mappedPosition": {
              "latitude": 42.9544249,"longitude": -2.2336662
            },"originalPosition": {
              "latitude": 42.9547,"longitude": -2.2334
            },"spot": 0.0839161,"sideOfStreet": "right","mappedRoadName": "","label": "N-I","shapeIndex": 2413,{
            "linkId": "-785506068","mappedPosition": {
              "latitude": 42.8375127,"longitude": -1.6827625
            },"originalPosition": {
              "latitude": 42.8375209,"longitude": -1.682764
            },"spot": 0.325,"mappedRoadName": "Calle E","label": "Calle E","shapeIndex": 3564,{
            "linkId": "+784694977","mappedPosition": {
              "latitude": 42.7655521,"longitude": -1.6340184
            },"originalPosition": {
              "latitude": 42.7655569,"longitude": -1.633923
            },"spot": 0.6483516,"mappedRoadName": "Calle A","label": "Calle A","shapeIndex": 3912,{
            "linkId": "+1167198260","mappedPosition": {
              "latitude": 42.7426922,"longitude": -1.6330802
            },"originalPosition": {
              "latitude": 42.742708,"longitude": -1.6330681
            },"spot": 0.3364486,"sideOfStreet": "neither","mappedRoadName": "Carretera Salinas","label": "Carretera Salinas","shapeIndex": 4006,{
            "linkId": "+1171177552","mappedPosition": {
              "latitude": 42.7354551,"longitude": -1.633918
            },"originalPosition": {
              "latitude": 42.73545,"longitude": -1.63392
            },"spot": 0.2121212,"mappedRoadName": "Polígono Industrial Morea Norte","label": "Polígono Industrial Morea Norte","shapeIndex": 4025,"source": "user"
          }
        ],"mode": {
          "type": "fastest","transportModes": [
            "car"
          ],"trafficMode": "disabled","feature": [
            {
              "value": "tollroad","weight": [
                "Byte",-3
              ]
            }
          ]
        },"boundingBox": {
          "topLeft": {
            "latitude": 43.3362329,"longitude": -2.5007308
          },"bottomRight": {
            "latitude": 42.7354002,"longitude": -1.6270387
          }
        },"leg": [
          {
            "start": {
              "linkId": "-1238197473","mappedPosition": {
                "latitude": 43.3362329,"longitude": -2.4982456
              },"originalPosition": {
                "latitude": 43.33631,"longitude": -2.4979
              },"source": "user"
            },"end": {
              "linkId": "+724111030","mappedPosition": {
                "latitude": 42.9544249,"longitude": -2.2336662
              },"originalPosition": {
                "latitude": 42.9547,"longitude": -2.2334
              },"length": 79900,"travelTime": 5026,"maneuver": [
              {
                "position": {
                  "latitude": 43.3362329,"longitude": -2.4982456
                },"instruction": "Diríjase al <span class=\"heading\">sur</span> por <span class=\"street\">Barrio Urrutia</span> <span class=\"number\">(BI-2405)</span>. <span class=\"distance-description\">Siga durante <span class=\"length\">170 m</span>.</span>","travelTime": 10,"length": 170,"firstPoint": 0,"lastPoint": 8,"note": [],"nextManeuver": "M2","toLink": "-1238197473","boundingBox": {
                  "topLeft": {
                    "latitude": 43.3362329,"longitude": -2.4984133
                  },"bottomRight": {
                    "latitude": 43.3347344,"longitude": -2.4981666
                  }
                },"shapeQuality": "exact","direction": "forward","action": "depart","roadName": "","nextRoadName": "Barrio Urrutia","roadNumber": "","nextRoadNumber": "BI-2405","trafficTime": 10,"baseTime": 10,"roadShield": {
                  "region": "ESP","category": "3","label": "BI-2405"
                },"startAngle": 163,"id": "M1","_type": "PrivateTransportManeuverType"
              },{
                "position": {
                  "latitude": 43.3347344,"longitude": -2.4983704
                },"instruction": "Continúe por <span class=\"number\">BI-2405</span>. <span class=\"distance-description\">Siga durante <span class=\"length\">1.3 km</span>.</span>","travelTime": 76,"length": 1298,"firstPoint": 8,"lastPoint": 42,"nextManeuver": "M3","toLink": "-1004767700","boundingBox": {
                  "topLeft": {
                    "latitude": 43.3347344,"longitude": -2.4983704
                  },"bottomRight": {
                    "latitude": 43.3243382,"longitude": -2.4930918
                  }
                },"action": "continue","roadName": "Barrio Urrutia","nextRoadName": "","roadNumber": "BI-2405","trafficTime": 76,"baseTime": 76,"startAngle": 171,"id": "M2",{
                "position": {
                  "latitude": 43.3243382,"longitude": -2.4930918
                },"instruction": "Continúe por <span class=\"next-street\">Atxurra</span> <span class=\"number\">(BI-2405)</span>. <span class=\"distance-description\">Siga durante <span class=\"length\">64 m</span>.</span>","travelTime": 3,"length": 64,"firstPoint": 42,"lastPoint": 43,"nextManeuver": "M4","toLink": "-799933634","boundingBox": {
                  "topLeft": {
                    "latitude": 43.3243382,"longitude": -2.4930918
                  },"bottomRight": {
                    "latitude": 43.3238447,"longitude": -2.4926949
                  }
                },"nextRoadName": "Atxurra","trafficTime": 3,"baseTime": 3,"startAngle": 149,"id": "M3",{
                "position": {
                  "latitude": 43.3238447,"longitude": -2.4926949
                },"instruction": "Continúe por <span class=\"number\">BI-2405</span>. <span class=\"distance-description\">Siga durante <span class=\"length\">4.6 km</span>.</span>","travelTime": 315,"length": 4571,"firstPoint": 43,"lastPoint": 223,"nextManeuver": "M5","toLink": "-909177678","boundingBox": {
                  "topLeft": {
                    "latitude": 43.3238447,"longitude": -2.4926949
                  },"bottomRight": {
                    "latitude": 43.3015716,"longitude": -2.4772775
                  }
                },"roadName": "Atxurra","trafficTime": 315,"baseTime": 315,"id": "M4",{
                "position": {
                  "latitude": 43.3015716,"longitude": -2.4783933
                },"instruction": "Continúe por <span class=\"next-street\">Barrio Ubilla Urberuaga</span> <span class=\"number\">(BI-2405)</span>. <span class=\"distance-description\">Siga durante <span class=\"length\">763 m</span>.</span>","travelTime": 64,"length": 763,"firstPoint": 223,"lastPoint": 252,"nextManeuver": "M6","toLink": "-1238195842","boundingBox": {
                  "topLeft": {
                    "latitude": 43.3015716,"longitude": -2.4797666
                  },"bottomRight": {
                    "latitude": 43.2969904,"longitude": -2.4754214
                  }
                },"nextRoadName": "Barrio Ubilla Urberuaga","trafficTime": 64,"baseTime": 64,"startAngle": 185,"id": "M5",{
                "position": {
                  "latitude": 43.2969904,"longitude": -2.4754214
                },"instruction": "Gire a la <span class=\"direction\">derecha</span> en <span class=\"next-street\">Barrio Ubilla Urberuaga</span> <span class=\"number\">(BI-633)</span>. <span class=\"distance-description\">Siga durante <span class=\"length\">4.0 km</span>.</span>","travelTime": 291,"length": 3994,"firstPoint": 252,"lastPoint": 371,"nextManeuver": "M7","toLink": "-1218484943","boundingBox": {
                  "topLeft": {
                    "latitude": 43.2969904,"longitude": -2.4975228
                  },"bottomRight": {
                    "latitude": 43.27299,"direction": "right","action": "rightTurn","roadName": "Barrio Ubilla Urberuaga","nextRoadNumber": "BI-633","trafficTime": 324,"baseTime": 291,"category": "2","label": "BI-633"
                },"startAngle": 118,"id": "M6",{
                "position": {
                  "latitude": 43.27299,"longitude": -2.4975228
                },"instruction": "Gire a la <span class=\"direction\">izquierda</span> en dirección a <span class=\"sign\">Calle Beko-Benta</span>. <span class=\"distance-description\">Siga durante <span class=\"length\">20 m</span>.</span>","travelTime": 5,"length": 20,"firstPoint": 371,"lastPoint": 373,"nextManeuver": "M8","toLink": "-77389318","boundingBox": {
                  "topLeft": {
                    "latitude": 43.27299,"bottomRight": {
                    "latitude": 43.2728291,"longitude": -2.4974155
                  }
                },"direction": "left","action": "leftTurn","roadNumber": "BI-633","nextRoadNumber": "","trafficTime": 5,"baseTime": 5,"startAngle": 203,"id": "M7",{
                "position": {
                  "latitude": 43.2728291,"longitude": -2.4974155
                },// REDACTED FOR BREVITY
// REDACTED FOR BREVITY
// REDACTED FOR BREVITY
// REDACTED FOR BREVITY
              
        "incident": [
          {
            "validityPeriod": {
              "from": "2021-02-03T05:56:19Z","until": "2021-02-12T06:11:28Z"
            },"text": "trabajos de construcción","type": "roadworks","criticality": 2,"firstPoint": 2110,"lastPoint": 2148
          }
        ],"label": [
          "A-10","N-I"
        ],"zone": []
      }
    ],"language": "es-es"
  }
}

编辑

原来有一条道路允许卡车通过这些路点,但由于它包含通行费,因此有必要从参数 tollroad:-3 中删除 mode=fastest;truck;tollroad:-3 部分,以便返回路线。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。