opensciencemap / vtm

a vector-tile map library written in java - running on android, desktop and within the browser
GNU Lesser General Public License v3.0
238 stars 176 forks source link

align zoom behavior to Gmaps when having map centered around location #63

Closed stleusc closed 10 years ago

stleusc commented 10 years ago

Feature to switch double-tap zoom to either zoom around tap location (currently like that) or zoom around center of map, keeping this centered! I need to be able to switch the two modes while the map is showing.

Another request that kinda fits in here (though not double tap, but still zoom) Request Feature to allow to disable zoom & drag map. Meaning a) allow 2 finger zoom AND drag/move map at the same time b) allow 2 finger zoom but dragging both fingers to move map will not move it

Good example is current Google Maps app. for a) move map around and then do 2 finger zoom and then drag both fingers to move map for b) center map on you and THEN do the above and you will see that the map does not move

Same procedure can be used to test the double tap zoom btw....

hjanetzek commented 10 years ago

So basically you want a mode where the user cannot move the map by touch gestures, right? Maybe one could do this in one place. I've commited some functions to ViewController to temporarily disable moveMap() - No time to test atm though :) Could you give it a try? https://github.com/opensciencemap/vtm/commit/328132d1de4f3246bca5e8f8bc64cd2263db7b97

stleusc commented 10 years ago

No that is not what I want. I want the gmaps behavior! I have a button to enable 'follow-me' mode, where the map centers user location. In that mode (also in gmaps) the map does not move while zooming! But of course you can just pan it around and turn of 'follow-me' with that. For the double tap zoom the map will keep the center fixed when 'follow-me' is active, otherwise it keeps the touch location fixed.

If that does not make sense, open gmaps and drag/zoom or double tap, then center on your location (button lower right corner) and try again!

stleusc commented 10 years ago

@hjanetzek nope, that commit would not do what I need at all :)

stleusc commented 10 years ago

@hjanetzek my commit does exactly what I need. Check it out, only few changes and that might explain what it is about.

hjanetzek commented 10 years ago

I see. Slightly refactored version of yours, not yet tested: https://github.com/opensciencemap/vtm/commit/1d869b841e4b8834dab705ae8c037cbfb63a35cb

stleusc commented 10 years ago

works as expected! you can merge it into master...

hjanetzek commented 10 years ago

Merged. Thanks for the patch!