我有本地的传单路由机(未从url加载),但是语言未正确加载。我必须包含文件吗?
包括我拥有的:
我的代码:
L.Routing.control({
router: L.Routing.mapbox('my key'),
language: 'nl',
formatter: new L.Routing.Formatter({
language: 'nl'
}),
waypoints:coordinates,
routeWhileDragging: true,
createMarker: function(i, wp, nWps) {
return L.marker(wp.latLng, {icon: greenIcon });
}
}).addTo(map);
错误:ReferenceError:模块未定义localization.js:112:2
网站:https://kunstgroepkolonieplasmolen.wiwitest.nl/atelierroute/
尝试将angularization.js添加到angular.json文件中的其他脚本中,如下所示:
"scripts": [
"node_modules/leaflet-routing-machine/src/localization.js"
]
然后,
L.Routing.control({
/....// <-- your others option
language: 'nl', // <-- for langage use just this
// you don't need to add formatter
formatter: new L.Routing.Formatter({
language: 'nl'
}),
}).addTo(map);