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

Adding another map and also adding double tap to zoom #39

Closed hamidr closed 10 years ago

hamidr commented 10 years ago

Hi there, I'm trying to integrate another map with vtm-android-example and as I found out there's an issue with tiles ordering on this particular map. According to my knowledge this map's TIleY starts from down (0) and fills the rest to end. But it seems the ordinary maps which vtm uses, start from up as tileY=0. Do you think I have to manipulate vtm core's to make this map running? or there's a better way to handle this situation?

Another feature I wanted to have was double tap event for zooming, though I found somethings in MapEventLayer class which seemed kinda It supports this feature. But it does not work right now. I mean I can see mDoubleTap but there's no use for it! Would you give me some info about it a little bit?

Thank you.

hjanetzek commented 10 years ago

Hi, the first one should be easy to do: overwrite getTileUrl() in your TileSource to flip the y ordinate, like

y = (1 << tile.zoomLevel) - 1 - tile.tileY;

I'll have a look at the double tap zoom. I guess vtm-android is just missing a DoubleTapGestureListener to forward the gesture to vtm

hamidr commented 10 years ago

It was fast :+1: Nice, It works like a charm :) Thank you.

hamidr commented 10 years ago

By the way, the map that I'm going to add is a partial one, so I wonder how I can tell OpenScienceMap that what area the map is limited to? What I'm looking for is something like "maxExtent" option of OpenLayers ( http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels ).

hjanetzek commented 10 years ago

I think setting the map limits should be added as option to Viewport. added to my todo.

hamidr commented 10 years ago

I'd be glad to work on it. Also I'm going to see If I can make double tap work in map as well. Though, Your guidance would make it super easier for me to go through this. Thank you.

hjanetzek commented 10 years ago

Thanks, there are enough things that still need work or polishing in the library. But the double tap scale is already committed :) - now pushed it to master. If you have questions or suggestions for implementing a feature, just let me know.

hamidr commented 10 years ago

neat :) thank you. you are the best. ;)