Page 1 of 1

native zoom and scroll

Posted: Fri Feb 21, 2014 1:10 pm
by gfquad
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.

Re: native zoom and scroll

Posted: Sun Feb 23, 2014 8:02 pm
by ChrisMukrow
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

Posted: Mon Feb 24, 2014 12:47 pm
by gfquad
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

Posted: Tue Feb 25, 2014 12:26 am
by Simon
Is this what you are looking for?
http://lessons.runrev.com/s/lessons/m/4 ... nch-motion

Simon

Re: native zoom and scroll

Posted: Tue Feb 25, 2014 12:09 pm
by gfquad
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

Posted: Tue Feb 25, 2014 12:34 pm
by LCNeil
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
-

Re: native zoom and scroll

Posted: Tue Feb 25, 2014 1:21 pm
by gfquad
Thanks Neil,
This looks promising. I'll do some testing and see if I can get it do what I need.
Geoff