iphoneStartTracking & IphoneCurrentLocation
Posted: Wed Nov 09, 2011 7:08 am
Hi, The script below asks the user for permission to get the GPS location but then does not populate the local Variable tWhereYouAt. (see script below) The next time I click to execute the script it doesn't ask permission and it loads the lat n long into the variable like I wish it did the first time. Any ideas?
The overall goal which I have achieved in TWO button clicks is... get the current location, load the var, alter the HTML, load the google map page url, then stop tracking to save battery life. I would like to do it in just one click. Any ideas?
on mouseUo
get iphoneCanTrackLocation()
if iphoneCanTrackLocation() is "false" then
answer "The devise can not track your location"
exit mouseup
end if
iphoneStartTrackingLocation
put iphoneCurrentLocation() into tLocation
put tLocation["latitude"] into tLat
put tLocation["longitude"] into tLong
put tLat & "," & tLong into tWhereYouAt
-------------------------------------------------------
## do aloto ada stuff TO DA HTML
## query a database for destination info and put it into tWhereYawannnaGo
## Load the page with tWhereYouAt and tWhereYawannnaGo identified on the map
iphoneStopTrackingLocation
end mouseUp
The overall goal which I have achieved in TWO button clicks is... get the current location, load the var, alter the HTML, load the google map page url, then stop tracking to save battery life. I would like to do it in just one click. Any ideas?
on mouseUo
get iphoneCanTrackLocation()
if iphoneCanTrackLocation() is "false" then
answer "The devise can not track your location"
exit mouseup
end if
iphoneStartTrackingLocation
put iphoneCurrentLocation() into tLocation
put tLocation["latitude"] into tLat
put tLocation["longitude"] into tLong
put tLat & "," & tLong into tWhereYouAt
-------------------------------------------------------
## do aloto ada stuff TO DA HTML
## query a database for destination info and put it into tWhereYawannnaGo
## Load the page with tWhereYouAt and tWhereYawannnaGo identified on the map
iphoneStopTrackingLocation
end mouseUp