Skip to content

Instantly share code, notes, and snippets.

@allthesignals
Last active April 5, 2019 19:10
Show Gist options
  • Save allthesignals/9f407baf3adbd4415048c1a25ecb64c9 to your computer and use it in GitHub Desktop.
Save allthesignals/9f407baf3adbd4415048c1a25ecb64c9 to your computer and use it in GitHub Desktop.
{{#mapbox-gl as |map|}}
{{map.on 'click' (action 'handleMapClick')}}
{{map.on 'mousemove' (action 'handleMouseMove')}}
{{!-- Two yields implicitly merge the mapbox-gl addon's block params API with our own
internal extensions --}}
{{yield map}}
{{yield (hash
dynamic-tiles=(component 'mapbox-gl-dynamic-tiles'
map=map
mapInstance=mapInstance
)
address-search=(component 'address-search' map=map)
filter-distance-from-point=(component 'filter-distance-from-point' map=map)
)}}
{{/mapbox-gl}}
{{#projects-map as |map|}}
{{!-- Regular mapbox-gl addon APIs --}}
{{map.call 'fitBounds' bounds (hash padding=20)}}
{{!-- Some project-specific extensions --}}
{{map.address-search
onSelectSearchResult=(action section.delegate-mutation
(action 'handleSearchResultSelect' 'distance_from_point')
)
onClearSearchResult=(action section.mutateWithAction)
}}
{{map.filter-distance-from-point
pointGeometry=distance_from_point
radius=radius_from_point
shouldQueryFullMap=section.filterIsActive
onRadiusFilterClick=(action section.delegate-mutation
(action 'handleRadiusFilterClick' 'distance_from_point')
)
}}
{{/projects-map}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment