nativescript-mapbox
nativescript-mapbox copied to clipboard
It doesn't work with angular
Hi, I can't make it work with Angular. The map appears, but the instance is undefined so I can't add layers or markers.
View:
<Mapbox
[accessToken]="mapboxAccessToken"
[mapStyle]="mapboxStyles.default"
latitude="0"
longitude="0"
hideCompass="false"
zoomLevel="12"
showUserLocation="false"
disableZoom="false"
disableRotation="false"
disableScroll="false"
disableTilt="false"
(mapReady)="onMapReady($event)">
</Mapbox>
Component:
registerElement("Mapbox", () => require("nativescript-mapbox").MapboxView);
.
.
.
onMapReady(args){
console.log('onMapReady()',args.map);
args.map.addSource();
}
I'm getting JS: ERROR TypeError: args.map.addSource is not a function error message
I could not see any "addSource" method in the examples I saw, could you provide a link for that?