nativescript-mapbox icon indicating copy to clipboard operation
nativescript-mapbox copied to clipboard

It doesn't work with angular

Open csimpi opened this issue 6 years ago • 1 comments

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

csimpi avatar Jan 19 '20 05:01 csimpi

I could not see any "addSource" method in the examples I saw, could you provide a link for that?

dylanbarquilla avatar Jan 20 '20 08:01 dylanbarquilla