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

panTo Duration Issues #83

Closed
JamesIves opened this issue Nov 1, 2016 · 6 comments
Closed

panTo Duration Issues #83

JamesIves opened this issue Nov 1, 2016 · 6 comments

Comments

@JamesIves
Copy link

Having issues with the duration when using panTo

Am I calling this correctly? It pans but the duration is always default no matter what value I set it to.

map.panTo([64.710824, -22.148438], {duration: 100});

@jdakowicz
Copy link

I found the issue in source code, there is a bug here.
This method is taking 7 parameters but we are passing 8 and the 8th one is our duration.
Quick fix is to override the panTo method in your script after you import the lib i.e.:
WebGLEarth.prototype.panTo = function(center, opt_opts) { if (!center.length) center = [center['lat'], center['lng']]; opt_opts = opt_opts || {}; this.flyTo(center[0], center[1], undefined, undefined, 0, 0, opt_opts['duration']) };
Or do a fix inside the imported file, find that method and change into this: r("WebGLEarth.prototype.panTo",function(a,b){x(a)||(a=[a.lat,a.lng]);b=b||{};this.Fa(a[0],a[1],void 0,void 0,0,0,b.duration)});

@klokan
Copy link
Member

klokan commented Jan 26, 2017

Great you tracked it down to code @jdakowicz

Could you please make a pull request here on GitHub - with the fix?

@liuweiGL
Copy link

liuweiGL commented Sep 9, 2017

JamesIves is great. By the way, I'd like to remind people that the unit is seconds

@syneva-runyan
Copy link

syneva-runyan commented Jul 16, 2018

Created a PR with jdakowicz fix described above #109

@williamdarkocode
Copy link

So whats the solution to this then? I'm getting sick of poorly designed apis.

@JamesIves
Copy link
Author

This issue is almost 4 years old, and the project is unmaintained according to the README. There's no reason to be rude however.

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

6 participants