Skip to content

Instantly share code, notes, and snippets.

@maletor
Created November 30, 2015 21:38
Show Gist options
  • Save maletor/a6c2686980a92a8fcfd7 to your computer and use it in GitHub Desktop.
Save maletor/a6c2686980a92a8fcfd7 to your computer and use it in GitHub Desktop.
hoverMarker: (e) =>
@map.featuresAt(e.point, { radius: 16, layer: 'markers' }, (err, features) =>
return unless features[0]
model = @collection.get(features[0].properties.id)
model.marker = 'secondary-marker'
return @addToMap()
)
@collection.each (model) ->
model.marker = 'default-marker'
@addToMap()
addToMap: =>
features = @collection.toGeoJSON()
@sourceObj.setData(features)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment