Angular 2 with systemjs. Mapbox is undefined
I'm trying to set up mapbox with Angular 2 and systemjs. Can't quite get it to work yet.
Here's a plunkr: http://plnkr.co/edit/m1ZYDALqu6tFYOMDPpC7
I'm installing with npm install mapbox.js --save and mapping "mapbox.js" in systemjs.config.js, to the mapbox.js package.
In my component I'm importing with import L from 'mapbox.js';.
I'm then creating a map with L.mapbox.map(this.map.nativeElement, 'mapbox.streets').setView([40, -74.50], 9); where this.map.nativeElementis the element in DOM.
I'll get error Cannot read property 'map' of undefined as you can see in the plunkr.
Anyone has any idea about what to do?
Hi,
This is the repository for Mapbox.js. You might be looking for angular-leaflet-directive or some other repository - Angular integration is unrelated to this codebase.