Displaying Google Maps (current location) using iPad GPS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Displaying Google Maps (current location) using iPad GPS
Hi Guys,
I am quite new to the livecode scene and want to know if this is possible.
I am trying to get the current location of the device (iPad) running the app and display it inside the app using the google maps API.
I already have a working HTML page which shows the current location if you run it inside a browser but it does not want to work inside the livecode app.
I have tried a few other example stacks but with no success.
Here is an example of some of the code in the stack:
global browserID
on mouseUp
put revBrowserOpen (the windowId of this stack, "url here") into browserID
revBrowserSet browserID, "scrollbars", false
revBrowserSet browserID, "showborder", true
revBrowserSet browserID, "rect",rect of image "browserimage"
put mobileCurrentLocation() into tLocation
answer tLocation -- This was to see if I cannot pass on the current co-ords to the html page instead of it relying on the internal sensor, I receive no answer though..
end mouseUp
Thanks
Regards.
I am quite new to the livecode scene and want to know if this is possible.
I am trying to get the current location of the device (iPad) running the app and display it inside the app using the google maps API.
I already have a working HTML page which shows the current location if you run it inside a browser but it does not want to work inside the livecode app.
I have tried a few other example stacks but with no success.
Here is an example of some of the code in the stack:
global browserID
on mouseUp
put revBrowserOpen (the windowId of this stack, "url here") into browserID
revBrowserSet browserID, "scrollbars", false
revBrowserSet browserID, "showborder", true
revBrowserSet browserID, "rect",rect of image "browserimage"
put mobileCurrentLocation() into tLocation
answer tLocation -- This was to see if I cannot pass on the current co-ords to the html page instead of it relying on the internal sensor, I receive no answer though..
end mouseUp
Thanks
Regards.
Re: Displaying Google Maps (current location) using iPad GPS
Hi Kevvy,
Welcome to the forum.
I take it you've seen that mobileCurrentLocation() returns an array with lat and long.
So you just grab them and tag them on the end of the URl.
e.g. http://maps.google.com/maps?q=55.953969,-3.198784
Simon
Edit.. You can't view an array with the answer dialog.
Welcome to the forum.
I take it you've seen that mobileCurrentLocation() returns an array with lat and long.
So you just grab them and tag them on the end of the URl.
e.g. http://maps.google.com/maps?q=55.953969,-3.198784
Simon
Edit.. You can't view an array with the answer dialog.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Displaying Google Maps (current location) using iPad GPS
Thanks Simon 
I tried the following:
put mobileCurrentLocation() into tLocation
put tLocation['latitude'] into lati
answer "Latitude:" & lati
And it returned blank on my iPad. Do you have to initialise location tracking first somewhere ?
Thanks again for the help.

I tried the following:
put mobileCurrentLocation() into tLocation
put tLocation['latitude'] into lati
answer "Latitude:" & lati
And it returned blank on my iPad. Do you have to initialise location tracking first somewhere ?
Thanks again for the help.
Re: Displaying Google Maps (current location) using iPad GPS
Yes, you have to mobileStartTrackingSensor.
Here:
http://lessons.runrev.com/s/lessons/m/4 ... al-compass
Tons of stuff to read in the Lessons.
You should start with them.
Simon
Here:
http://lessons.runrev.com/s/lessons/m/4 ... al-compass
Tons of stuff to read in the Lessons.
You should start with them.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Displaying Google Maps (current location) using iPad GPS
thanks Simon, I got the tracking working and sending the lat and long on to the google maps page. However for the life of me I cannot get the browser image displaying on my iPad. It displays on my windows box but not on my mac box (both have a connection to the internet and that specific php page which generates the map.
does anyone have any ideas to display an image of a webpage inside an iOS application ?
Regards
does anyone have any ideas to display an image of a webpage inside an iOS application ?

Regards
Re: Displaying Google Maps (current location) using iPad GPS
What happens when put the URL into iPad's Safari?
Simon
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Displaying Google Maps (current location) using iPad GPS
it opens up fine. i found the browser control tutorial which I am working through to see if i can find a solution.Simon wrote:What happens when put the URL into iPad's Safari?
Simon
Re: Displaying Google Maps (current location) using iPad GPS
Thanks to RunRev.
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Re: Displaying Google Maps (current location) using iPad GPS
thanks for the replies, I just cant get it working 
I basically have a rectangle which i want to display the current location via google maps in this rectangle.
I do have a working php page which runs on my web server and displays the current location or location given, but how to let this display live in the rectangle ?
thanks again.
Kevvy.

I basically have a rectangle which i want to display the current location via google maps in this rectangle.
I do have a working php page which runs on my web server and displays the current location or location given, but how to let this display live in the rectangle ?
thanks again.
Kevvy.
Re: Displaying Google Maps (current location) using iPad GPS
I am thinking the rectangle you are referring to should be the live code browser control
have a look at the sample app in the hyperlink I posted immediately above
have a look at the sample app in the hyperlink I posted immediately above
Thanks to RunRev.
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Re: Displaying Google Maps (current location) using iPad GPS
Thanks for the reply, I couldn't use that example as the stack would not open. It says that it is corrupted.LC4iOS wrote:I am thinking the rectangle you are referring to should be the live code browser control
have a look at the sample app in the hyperlink I posted immediately above
Re: Displaying Google Maps (current location) using iPad GPS
http://ftp.runrev.com/forums/viewtopic. ... 83&p=79766
I'm thinking the mobile objects might not be available in the non-licensed / community versions of LiveCode.
Maybe someone with the 6.5 commercial version of LiveCode would be so kind as to download and try to open.
To test mobile apps on the desktop you have to run it thru the simulator.
To test mobile apps on the device you have to have
1. a licensed version of LiveCode
2. a paid Apple iOS developers membership
3. an incredible amount of patience and time and effort
for stepping thru word by word on step by step procedures
(i've written some recently on this forum)
I'm thinking the mobile objects might not be available in the non-licensed / community versions of LiveCode.
Maybe someone with the 6.5 commercial version of LiveCode would be so kind as to download and try to open.
To test mobile apps on the desktop you have to run it thru the simulator.
To test mobile apps on the device you have to have
1. a licensed version of LiveCode
2. a paid Apple iOS developers membership
3. an incredible amount of patience and time and effort
for stepping thru word by word on step by step procedures
(i've written some recently on this forum)
Thanks to RunRev.
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Re: Displaying Google Maps (current location) using iPad GPS
LCMaps8ForLC6.5
I copied all the controls from my Licensed LC.5.5.5 over to a new MainStack in Livecode 6.5 Community.
Tested opening in LC 6.5 Community without error.
Have not tested any further as I don't have a LiveCode 6.5 Professional license.
See how you go.
I copied all the controls from my Licensed LC.5.5.5 over to a new MainStack in Livecode 6.5 Community.
Tested opening in LC 6.5 Community without error.
Have not tested any further as I don't have a LiveCode 6.5 Professional license.
See how you go.
- Attachments
-
- LCMaps9ForLC6.5.livecode.zip
- (4.15 KiB) Downloaded 322 times
Last edited by LC4iOS on Tue Jan 21, 2014 9:25 am, edited 1 time in total.
Thanks to RunRev.
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Thanks to LiveCode forum members.
LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member
Re: Displaying Google Maps (current location) using iPad GPS
Thanks a mil!!, it is opening on my side now, I will have a look and see if i can get it working on my side.