Open shmarts opened 4 years ago
This may be a dumb question, but are you clicking on a rendered feature of that layer (not just on the map generally)? @click and @mouseenter/leave are working in my project using the most recent release.
I'm having the same problem with clusters. The @click event fires for the layer that has the cluster circle, but not for the unclustered layer. Something seems broken.
Maybe it's an issue with layers that reference an existing source?
Same problem, I tried all events but none were fired.
In the clusters layer is working but not in a geojsonlayer.
Here is some of my code:
<MglMap ref="map" :accessToken="accessToken" :mapStyle.sync="mapStyle" :center="center" :zoom="zoom" @load="onMapLoaded">
<MglGeojsonLayer v-for="myLayer in geoJsonLayer" sourceId="places" :source="geoJsonSource" ref=myLayer.layerID layerId=myLayer.layerID :layer="myLayer" :key="'places' + myLayer.mapKey" @click="handleLayerClick" @mouseenter="handleLayerClick" />
handleLayerClick(event) { console.log(event); },
Anyone with a solution? Thanks!
When I bind an event listener to MglGeojsonLayer it doesn't seem to emit the event
This is my template, am I doing something wrong? handleClick isn't seeming to get triggered