LouisMazel / vue2-leaflet-movingmarker

MovingMarker plugin extension for vue2-leaflet package
https://louismazel.github.io/vue2-leaflet-movingmarker/
MIT License
24 stars 14 forks source link

Unable to change duration after mounting #3

Closed SoloSteve closed 4 years ago

SoloSteve commented 4 years ago

Hi. I came across a problem where I could not dynamically change the duration of the moving marker.

It would throw an error e[r] is not a function.

After some debugging I figured out that e is the mapObject and r is the string "setDuration".

To solve my issue I added the following code:

mounted() {
  this.$nextTick(() => {
    this.$refs.marker.mapObject.setDuration = () => {};
  });
}

I am not familiar with Vue all that much so I don't know why it's happening.

Maybe you can take a look at it and fix the issue?

LouisMazel commented 4 years ago

Hi,

I not sure to understand...

To see this, I created a demo app: DEMO You can update the duration after mounting without bug...

For info: I just released the version 1.1.0

LouisMazel commented 4 years ago

You have to pass the duration by the props attributs

<l-moving-marker
  :lat-lng="l.latlng"
  :duration="duration"
/>