native zoom and scroll
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
native zoom and scroll
Hi there, I'm hoping someone can help with this.
I'm trying to make an app which has the option to look at a map of a local area. I want the user to be able to zoom and scroll round the map using touch swipe and pinch zoom gestures.
I can use a native scroller to scroll around the map, but it doesn't seem to support zooming.
I have used a more manual method of tracking touches to zoom and scroll, but it's very complicated and the algebra isn't quite right. I've set a limit to the amount you can zoom in, but once you reach that limit if you carry on trying to zoom, while it keeps the same zoom level it quickly tracks to the bottom right of the map. Also using this method you don't get the continuation of movement if you swipe to scroll and let go, it stops as soon as the touch stops.
Is there a 'proper' way to do this. It seems to me like one of the most basic things you'd want to be able to do with a mobile app.
Thanks.
I'm trying to make an app which has the option to look at a map of a local area. I want the user to be able to zoom and scroll round the map using touch swipe and pinch zoom gestures.
I can use a native scroller to scroll around the map, but it doesn't seem to support zooming.
I have used a more manual method of tracking touches to zoom and scroll, but it's very complicated and the algebra isn't quite right. I've set a limit to the amount you can zoom in, but once you reach that limit if you carry on trying to zoom, while it keeps the same zoom level it quickly tracks to the bottom right of the map. Also using this method you don't get the continuation of movement if you swipe to scroll and let go, it stops as soon as the touch stops.
Is there a 'proper' way to do this. It seems to me like one of the most basic things you'd want to be able to do with a mobile app.
Thanks.
-
- Posts: 73
- Joined: Mon Nov 12, 2012 4:13 pm
Re: native zoom and scroll
What you could do is embed Google Maps with a webview (online or offline version --> http://forums.runrev.com/phpBB2/viewtop ... =49&t=7871). Unfortunately I haven't seen a native way to do this in Android (ready to go), in iOS you can use a plugin MergMk from MergExt.
Re: native zoom and scroll
Thanks Chris, but I need to use a map that I've created because it's for a very small area with much more detail than google maps.
Re: native zoom and scroll
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: native zoom and scroll
Unfortunately not. I've been through that tutorial and it's just for pinch zoom with no scrolling. I can't see anyway to combine this with native scrolling because the native scroller is set up in preOpenCard.
Re: native zoom and scroll
Hi gfQuad,
The easiest option would be to create a native mobile browser that links to your local map image. You will then be able to use both pinch to zoom and drag to scroll as required.
There is a great sample stack of how to do this in the following forum post-
http://forums.runrev.com/viewtopic.php?f=49&t=11229
I hope this gives you some leads
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-
The easiest option would be to create a native mobile browser that links to your local map image. You will then be able to use both pinch to zoom and drag to scroll as required.
There is a great sample stack of how to do this in the following forum post-
http://forums.runrev.com/viewtopic.php?f=49&t=11229
I hope this gives you some leads
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-
Re: native zoom and scroll
Thanks Neil,
This looks promising. I'll do some testing and see if I can get it do what I need.
Geoff
This looks promising. I'll do some testing and see if I can get it do what I need.
Geoff