Touching the current location on a map

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
GoneToSail
Posts: 32
Joined: Sun Jan 24, 2010 10:34 pm

Touching the current location on a map

Post by GoneToSail » Fri Sep 16, 2016 10:32 pm

After the command mobileStartTrackingSensor "location" has been called, a user can display an annotation named "Current Location" by touching the blue circle showing this location. At that time, is there any message sent to the card so that a handler can be called with a script allowing, for instance, the display of the current coordinates ?
Thanks for any assistance !

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: Touching the current location on a map

Post by Dixie » Sat Sep 17, 2016 10:19 pm

Let's say that you call

Code: Select all

 mobileStartTrackingSensor "location", true
in the openStack handler... then the current location is updated every time you change your location... the new coordinates can be displayed with the lat/long provided by the 'locationcahanged' handler

Code: Select all

on locationChanged latitude, longitude
   --set the theCurrentLocation of this stack to latitude & comma & longitude
   put latitude & comma & longitude into fld "currLocation"
end locationChanged

GoneToSail
Posts: 32
Joined: Sun Jan 24, 2010 10:34 pm

Re: Touching the current location on a map

Post by GoneToSail » Sun Sep 18, 2016 11:59 am

Thanks Dixie !
I have already done this, but I'm actually trying to display the coordinates ONLY when the user is touching the blue circle representing the current location. Any idea ?

Post Reply

Return to “iOS Deployment”