Mouse events not firing on geojson layer
Closed this issue · 1 comments
schlesingermatthias commented
Hi,
I'm trying to capture mouse events on a geojson layer, but I can seem to get it to work. Here's my template:
<LeafletMap @bounds={{model.mapBounds}} class="l-full-height leaflet-map" as |layers|>
<layers.tile @url="..."/>
<layers.geojson @geoJSON={{geoJson}} @style={{style}} @onMouseover={{action "geojsonMouseOver"}} as |g|>
{{#g.tooltip direction="top"}}
...
{{/g.tooltip}}
</layers.geojson>
</LeafletMap>
Am I missing something? Thank you
schlesingermatthias commented
<layers.geojson @geoJSON={{geoJson}} @style={{style}} @onEachFeature={{onEachFeature}}/>
@action onEachFeature(feature, layer) { layer.on({ mouseover: () => { this.geojsonMouseOver(feature, layer); }, }); }
works.