Hi, I’m trying to develop the example: “taxi cars dispatcher” with angular but I can not get the latitude and longitude when I do click in map.
How I can do develop this code in typescript and angular?
map.on('click', function (event) {
**const position = event.lngLat;**
tt.services.reverseGeocode({
key: apiKey,
position: position
})
.go().then(function (results) {
drawPassengerMarkerOnMap(results);
});
});
In my component.html I have:
< div id=‘map’
(click)=‘myFunctionToGetCoordinates($event)’
but in my component.ts , I can’t get event.lngLat like the example
How can I do this?
Thanks