Mobile Location
Moderators: LCNeil, heatherlaine, kevinmiller, elanorb
Re: Mobile Location
Can LC use the metadata of a picture to find the location the picture was taken?
Re: Mobile Location
Am I on the right track with trying to use the following script to convert to a city?
Code: Select all
put "http://maps.googleapis.com/maps/api/geocode/json?address="&tLocationArray&"&sensor=false" into tURL
Re: Mobile Location
Hi Mark,
There are no direct functions for extracting the metadata of an image. However, there is a 3rd party library has been created by another LiveCode user which you may find useful-
http://tweedly.org/showpage.lc?page=EXIFLib
In regards to converting coordinates to a city, you are on the right path but you need to use the reverse Geocode as described on the Google maps api page
The above also requires an API key. Google explain how to create this here-
https://developers.google.com/maps/docu ... g/#api_key
and the data that is returned will be in the JSON format. Elanor explains how to parse such data in Lesson 6 of the idea2app course.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
There are no direct functions for extracting the metadata of an image. However, there is a 3rd party library has been created by another LiveCode user which you may find useful-
http://tweedly.org/showpage.lc?page=EXIFLib
In regards to converting coordinates to a city, you are on the right path but you need to use the reverse Geocode as described on the Google maps api page
Code: Select all
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false&key=API_KEY
https://developers.google.com/maps/docu ... g/#api_key
and the data that is returned will be in the JSON format. Elanor explains how to parse such data in Lesson 6 of the idea2app course.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
Re: Mobile Location
I have a couple of questions about the reverse lookup string. For the longitude and latitude would I use the "tLatitude" and "tLongitude" to get the coordinates? Would I put this string in the handler "showCurrentLocation"?
https://maps.googleapis.com/maps/api/ge ... ey=API_KEY
https://maps.googleapis.com/maps/api/ge ... ey=API_KEY
Re: Mobile Location
Hi Mark,
tLatitude and tLongitute are temporary variables that used throughout functions within the maps card of the idea2app sample stack. You will have to be sure to correctly return these values to where you are generating the geocode url.
showCurrent location triggers display url which opens a ben browser with a given URL, so this might not be suitable for what you are trying to do. You may wish to look into creating a separate handler for this specific purpose.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
—
tLatitude and tLongitute are temporary variables that used throughout functions within the maps card of the idea2app sample stack. You will have to be sure to correctly return these values to where you are generating the geocode url.
showCurrent location triggers display url which opens a ben browser with a given URL, so this might not be suitable for what you are trying to do. You may wish to look into creating a separate handler for this specific purpose.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
—
Re: Mobile Location
Let me see if I am on the right track to create a separate handler. I want to put the Longitude and latitude to a value. I want to use the reverse look up to get a city and put that city into a variable. I want to call that variable on the mouseUp handler to put the city into the corresponding field. Am I on the right track?
Re: Mobile Location
Hi Mark,
Yes that does sound like a viable option fro what you are looking to achieve. As long as you have the longitue and latitued you will be able to post them to the Goolgle Geocode service. Google will then return JSON data according to your request which you will be able to parse to get the required data you need. This data can then be placed into a variable and then into a field.
so a break down would be-
1) Get Long and Lat of current location (mobileCurrentLocation)
2) Create Google Geocode URL and execute URL call
3) Parse returned JSON to extract data you need
4) Place this data into a variable and then place into the relevant field
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
Yes that does sound like a viable option fro what you are looking to achieve. As long as you have the longitue and latitued you will be able to post them to the Goolgle Geocode service. Google will then return JSON data according to your request which you will be able to parse to get the required data you need. This data can then be placed into a variable and then into a field.
so a break down would be-
1) Get Long and Lat of current location (mobileCurrentLocation)
2) Create Google Geocode URL and execute URL call
3) Parse returned JSON to extract data you need
4) Place this data into a variable and then place into the relevant field
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——