Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync while flying? #52

Open
tapiamcclung opened this issue Apr 4, 2018 · 2 comments
Open

Sync while flying? #52

tapiamcclung opened this issue Apr 4, 2018 · 2 comments

Comments

@tapiamcclung
Copy link

Great plugin! Very easy to use!
Is it possible to show the map in sync while using flyTo() and flyToBounds() on the original map, much like it happens when you zoom or pan?
Inside L.Extend I tried adding

flyTo: function (offset, options, sync) {
    if (!sync) {
        originalMap._syncMaps.forEach(function (toSync) {
            toSync.flyTo(offset, options, true);
        });
    }
    return L.Map.prototype.flyTo.call(this, offset, options);
}

but didn't work. Any suggestions?

@jjimenezshaw
Copy link
Contributor

In my opinion, the way Leaflet animates the flyTo does not permit this plugin to sync the maps 'while flying'. It does at the end, that is when internally makes a setView. Maybe Jieter has a better explanation/solution.

PS: flyTo has other parameters: latlng, zoom, options

@jieter
Copy link
Owner

jieter commented Jun 6, 2018

Hard to know for sure without trying, but I think we could trigger the flyTo on the synced map....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants