I defined addMarker and polylineClick functions. addMarker is called when clicking on the map and polylineClick is called when clicking on a polyline. But when I click on a polyline, map click event also occurs and addMarker function is called.

How can I disable map click event when I click on a polyline?

Here is the code:



      v-for="(stop,index) in stops"
      v-if="index < stops.length -1 "
      :lat-lngs="[getLatLng(stops[index].lat,stops[index].long), getLatLng(stops[index+1].lat,stops[index+1].long)]"


methods: {
                console.log('polyline click')



           addMarker(event, openDrawer=true, index=-1) {
            console.log('map click')

I use Vue2-leaflet .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.