Openlayers 未捕获(承诺中)TypeError:获取错误失败

Openlayers 未捕获(承诺中)TypeError:获取错误失败,openlayers,osrm,Openlayers,Osrm,我试图在自己的服务器上实现这个示例。但它不能正常工作。当我点击绘图点时,图标有时不会出现。然后它给出了许多错误。就在这里吗 var points = [], msg_el = document.getElementById('msg'), url_osrm_nearest = 'https://router.project-osrm.org/nearest/v1/driving/', url_osrm_route = 'ht

我试图在自己的服务器上实现这个示例。但它不能正常工作。当我点击绘图点时,图标有时不会出现。然后它给出了许多错误。就在这里吗

var points = [],
            msg_el = document.getElementById('msg'),
            url_osrm_nearest = 'https://router.project-osrm.org/nearest/v1/driving/',
            url_osrm_route = 'https://router.project-osrm.org/route/v1/driving/',
            icon_url = 'https://cdn.rawgit.com/openlayers/ol3/master/examples/data/icon.png',
            vectorSource = new ol.source.Vector(),
            vectorLayer = new ol.layer.Vector({
              source: vectorSource
            }),
            styles = {
              route: new ol.style.Style({
                stroke: new ol.style.Stroke({
                  width: 6, color: [40, 40, 40, 0.8]
                })
              }),
              icon: new ol.style.Style({
                image: new ol.style.Icon({
                  anchor: [0.5, 1],
                  src: icon_url
                })
              })
            };
我怎样才能解决它