我尝试了很多次,但没有结果我想显示出发地址和目的地地址的问题,但我发现 thar erreur
this.routing = L.Routing.control({
waypoints: [
...
],
language: 'fr',
showAlternatives: true,
routeWhileDragging: true,
reverseWaypoints: true,
routeDragInterval: 0,
autoRoute: true,
**geocoder: L.Control.Geocoder.nominatim(),**
altLineOptions: {
styles: [
{color: 'black', opacity: 0.1, weight: 11},
{color: 'white', opacity: 0.25, weight: 9},
{color: 'blue', opacity: 0.25, weight: 3}
]
},
lineOptions: {
styles: [
{color: 'black', opacity: 0.3, weight: 11},
{color: 'white', opacity: 0.9, weight: 9},
{color: 'red', opacity: 1, weight: 3}
]
},
}
}
}).addTo(map);
this.map = map;
错误的图像https://i.stack.imgur.com/17oP2.png
这是我的错误:
块引用
core.js:4442 ERROR TypeError: Cannot read property 'nominatim' of undefined at AppComponent.ngOnInit (app.component.ts:60) at callHook (core.js:3281) .....