ember-mapbox-gl
Ember integration with mapbox-gl-js.
Installation
ember install ember-mapbox-gl
Then, add your Mapbox access token:
module.exports = function(environment) {
let ENV = {
'mapbox-gl': {
accessToken: 'ACCESS TOKEN HERE'
},
}
BEWARE - API CHANGES HAPPENING
We are currently modifying the api to more closely resemble the Mapbox api. We aim to make this update seamless to any existing users, with warnings of deprecations. You can follow along on this issue: https://github.com/kturney/ember-mapbox-gl/issues/2
Example
{{#mapbox-gl as |map|}}
{{#map.source data=wanderDrone as |source|}}
{{source.layer layerType='symbol' layoutOptions=(hash icon-image='rocket-15')}}
{{/map.source}}
{{#if curLocation}}
{{#map.marker lngLat=curLocation as |marker|}}
{{#marker.popup}}
This is where you are!
{{/marker.popup}}
{{/map.marker}}
{{map.call 'easeTo' (hash center=curLocation)}}
{{/if}}
{{map.on 'click' (action 'onClick')}}
{{/mapbox-gl}}