Page 1 of 1

Show points and routes with Google Maps in iOS

Posted: Fri Mar 25, 2011 10:39 pm
by JosepM
Hi,

Any experiences about how in iOS show routes and points into a Google Map?
Attach some images to show what I trying.

Also I guess that using the GPS location, center a map and show points of interest or marks. Using the GoogleMap kit I be able of center a map into a stack but with iOS I can't.

Thanks in advance.

Salut,
JosepM

Re: Show points and routes with Google Maps in iOS

Posted: Sat Mar 26, 2011 8:53 am
by JosepM
I found that with the Google Maps API V3 I can show that I need.

iphoneControlDo id, "load", baseUrl, htmlText
Loads as page consisting of the given htmlText with the given baseUrl (wraps the loadHtmlString method of UIWebView).

Locally I can read from my database the stored marks and prepare the HTML, then load into the Browser.

In htmlText I put my HTML code, and the URL in baseURL.

But now how can I handle the click over a mark into the map to go to one card of the stack? Any idea if is posible?

Salut,
Josep

Re: Show points and routes with Google Maps in iOS

Posted: Sat Mar 26, 2011 12:59 pm
by BvG
it's probably something with "iphoneControlGet". I'm not doing iOS dev, so can't say what parameter it'd be, sorry.

Re: Show points and routes with Google Maps in iOS

Posted: Sun Mar 27, 2011 4:25 am
by landoke
The way I've done work with a web view in iOS before and interacting back with the code is by catching the "browserLoadRequest".

(You also need to make sure to set: iphoneControlSet sBrowserId, "delayRequests", "true")

This way you can, say, create a fake URL that you access that has some unique identifying feature about it which you can then parse and intercept. For example, in the code, create a link associated with the pin that goes to http : / / example . com/?myUniqueCode=43.28271,-71.72532

Then, in LiveCode card script:

Code: Select all

on browserLoadRequest pUrl, pReason
    if pUrl contains "?myUniqueCode=" then
        put char offset("?myUniqueCode=",14) to -1 of pUrl into pCode
        -- Do something with pCode
    else
        pass browserLoadRequest
    end if
end browserLoadRequest

Re: Show points and routes with Google Maps in iOS

Posted: Sun Mar 27, 2011 9:55 pm
by JosepM
Hi,

Many thanks, is just that I need. So in this way you can trap each load request before this will be completed, from the marks or whatever, isn't?

Salut,
Josep

Re: Show points and routes with Google Maps in iOS

Posted: Thu Sep 22, 2011 8:45 pm
by FireWorx
Great post thanks!