jieter / Leaflet.Sync

Synchronized view of two maps.
http://jieter.github.io/Leaflet.Sync/examples/dual.html
BSD 3-Clause "New" or "Revised" License
235 stars 53 forks source link

Fix inertia #44

Closed jjimenezshaw closed 7 years ago

jjimenezshaw commented 7 years ago

As shown in #43, inertia is a problem when clicking one of the maps. Here we fix it, triggering a setView on events 'click' and 'dragstart'. Method _stop is overloaded to react quickly. setView then will only adjust a few pixels.

Unfortunately I don't see how to test the inertia in the tests :disappointed:

In addition, isSynced is completed to support an argument (used in one example). Also setView is fixed to do not flicker when sync is done only in one direction. Documentation also includes some complementary information about offset functionality. File examples/select_syncs.html is added. There you can enable and disable sync between different maps (all the same osm)

jieter commented 7 years ago

Please have a look at the tests, CI reports failures...

jieter commented 7 years ago

released leaflet.sync@0.1.2