wiseman / mavelous

multi-platform ground station for drones that speak the MAVLink protocol
MIT License
168 stars 85 forks source link

In pan-locked mode, zoom should be centered on vehicle icon #40

Closed wiseman closed 11 years ago

wiseman commented 11 years ago

If I zoom while the app is in map-follows-vehicle mode, the zooming happens with the touch/mouse location as the center, then when zooming is complete the map pans to center the vehicle icon. It should instead zoom with the vehicle icon as the center.

pchickey commented 11 years ago

fixed by d5612466a

wiseman commented 11 years ago

Annoyingly, it looks like scroll wheel zoom is handled differently from touch pinch/pull zoom--this change fixes the former but not the latter. At least it also fixes emulated scroll wheel zooms like the two-finger scroll on Mac trackpads/magic mice!

wiseman commented 11 years ago

It looks like we could subclass L.Map.TouchZoom and override its _getScaleOrigin method to fix touch zooms.

pchickey commented 11 years ago

I don't feel comfortable subclassing (don't really understand how in JS, and usually regret it in general) but I'll make a similar fix as I did for the scroll wheel handler.

On Tue, Jan 1, 2013 at 3:19 PM, John Wiseman notifications@github.comwrote:

It looks like we could subclass L.Map.TouchZoom and override its _getScaleOrigin method to fix touch zooms.

— Reply to this email directly or view it on GitHubhttps://github.com/wiseman/mavelous/issues/40#issuecomment-11797278.

pchickey commented 11 years ago

I got it to stay centered as a result of pinch zooming, but during the zoom, the animation still pans it. This is annoying and I'm not sure if I'm just missing something simple...