vue-mapbox icon indicating copy to clipboard operation
vue-mapbox copied to clipboard

Listening on layer events

Open francois2metz opened this issue 4 years ago • 2 comments

Hi,

I would like to support the listening of events on a specific layer, the ones you can catch with "on(type, layerId, listener)". It works when we add a specific layer, but not on the map.

I'm thinking of adding special events handlers, such as: click-layerid, mousedown-layerid, and so on...

<template>
  <MglMap
    :map-style="..."
    @mouseover-poi="handleMouseOver"
    @click-poi="handleClick"
  ></MglMap>
</template>

<script>
export default {
  methods: {
    handleClick() {},
    handleMouseOver(e) { e.map.getCanvas().style.cursor = 'pointer';}
  }
}
</script>

What do you think ?

francois2metz avatar Oct 22 '19 18:10 francois2metz

You already have those in this library.

Common layer evts: https://soal.github.io/vue-mapbox/api/Layers/#events

vinayakkulkarni avatar Oct 26 '19 17:10 vinayakkulkarni

Yes I would have to add a layer, but they are already on the original source and style.

francois2metz avatar Oct 28 '19 08:10 francois2metz