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

FlyTo with targetCenter == currentCenter not animated #3663

Merged
merged 1 commit into from Aug 7, 2015
Merged

FlyTo with targetCenter == currentCenter not animated #3663

merged 1 commit into from Aug 7, 2015

Conversation

fminuti
Copy link
Contributor

@fminuti fminuti commented Jul 23, 2015

Please see http://jsfiddle.net/v1so6m56/4/

If targetCenter is the same of currenteCenter, the parameter u1 (the distance between "to" and "from") is 0.

The proposed patch resolve this by forcing the distance to 1.

Please see http://jsfiddle.net/v1so6m56/4/

If targetCenter is the same of currenteCenter the parameter u1 (the distance between "to" and "from" is 0.

The proposed patch resolve this by forcing the distance to 1.
@mourner
Copy link
Member

mourner commented Jul 23, 2015

Thanks for the PR! The proposed change looks like a hack though, I wonder if I can find a more elegant solution...

@IvanSanchez
Copy link
Member

After fiddling with this for quite a while, I don't think it's easy to come up with a version of the r(i) function that works OK for a distance of zero. Using a minimum distance of one pixel (as this PR does) doesn't sound like a bad idea after all.

@mourner
Copy link
Member

mourner commented Jul 30, 2015

I'll take a look.

@mourner
Copy link
Member

mourner commented Aug 7, 2015

So, I was going to port over the special case from here but it's complicated and this one seems to produce exactly the same results. :)

mourner added a commit that referenced this pull request Aug 7, 2015
FlyTo with targetCenter == currentCenter not animated
@mourner mourner merged commit d17e53b into Leaflet:master Aug 7, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants