Skip to content

Instantly share code, notes, and snippets.

@allthesignals
Last active July 24, 2018 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allthesignals/b43bac084c6278165722b92480b0dcf8 to your computer and use it in GitHub Desktop.
Save allthesignals/b43bac084c6278165722b92480b0dcf8 to your computer and use it in GitHub Desktop.
{{#mapbox-gl class='map-container' initOptions=initOptions as |map|}}
{{#map.source options=bikeLaneSourceOptions as |source|}}
{{source.layer layer=bikeLaneStyles}}
{{/map.source}}
{{/mapbox-gl}}
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
initOptions: {
pitch: 30,
},
bikeLaneStyles: {
type: 'line',
paint: {
'line-color': '#007cbf',
'line-width': 10,
},
},
bikeLaneSourceOptions: computed('data', function() {
const { data } = this;
return {
type: 'geojson',
data,
};
}),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment