native zoom and scroll

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gfquad
Posts: 7
Joined: Wed Nov 13, 2013 11:29 am

native zoom and scroll

Post by gfquad » Fri Feb 21, 2014 1:10 pm

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.

ChrisMukrow
Posts: 73
Joined: Mon Nov 12, 2012 4:13 pm

Re: native zoom and scroll

Post by ChrisMukrow » Sun Feb 23, 2014 8:02 pm

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.

gfquad
Posts: 7
Joined: Wed Nov 13, 2013 11:29 am

Re: native zoom and scroll

Post by gfquad » Mon Feb 24, 2014 12:47 pm

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: native zoom and scroll

Post by Simon » Tue Feb 25, 2014 12:26 am

Is this what you are looking for?
http://lessons.runrev.com/s/lessons/m/4 ... nch-motion

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

gfquad
Posts: 7
Joined: Wed Nov 13, 2013 11:29 am

Re: native zoom and scroll

Post by gfquad » Tue Feb 25, 2014 12:09 pm

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.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: native zoom and scroll

Post by LCNeil » Tue Feb 25, 2014 12:34 pm

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
-

gfquad
Posts: 7
Joined: Wed Nov 13, 2013 11:29 am

Re: native zoom and scroll

Post by gfquad » Tue Feb 25, 2014 1:21 pm

Thanks Neil,
This looks promising. I'll do some testing and see if I can get it do what I need.
Geoff

Post Reply