hallahan / LeafletPlayback

This is a Leaflet plug-in that plays back points that have a time stamp synchronized to a clock.
http://leafletplayback.theoutpost.io
Other
482 stars 165 forks source link

Possible bug using addTracks function #9

Closed JulioV closed 10 years ago

JulioV commented 10 years ago

I'm using the LeafletPlaybackWithDeps.js file in the dist folder of the master.I tried to add a new track programmatically using the addTracks function but it fails in the line:

https://github.com/hallahan/LeafletPlayback/blob/master/src/Tick.js#L23

because the map reference is wrong( in my case it points to the map div instead the Leaflet map class).

So what I did was:

1.- Add the line "this.map = map" after line https://github.com/hallahan/LeafletPlayback/blob/master/src/Tick.js#L5 (in the initialization function of L.Playback.Tick.)

2.- Change the reference of "map" to "this.map" in line https://github.com/hallahan/LeafletPlayback/blob/master/src/Tick.js#L23

Now it works fine, so is ok if I update the code in the repository?

hallahan commented 10 years ago

Makes sense. I will merge your pull request. Sorry for responding so late. I guess you email slipped through my inbox...

hallahan commented 10 years ago

Done lbutler@55d35f6