forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocationChanged.lcdoc
More file actions
62 lines (45 loc) · 1.67 KB
/
Copy pathlocationChanged.lcdoc
File metadata and controls
62 lines (45 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Name: locationChanged
Type: message
Syntax: locationChanged <pLatitude>, <pLongitude>, <pAltitude>
Summary:
Sent to the current card of the default stack when the location of the
device changes.
Introduced: 4.5.2
OS: ios, android
Platforms: mobile
Example:
on locationChanged pLatitude, pLongitude, pAltitude
put pAltitude into field "altitude"
end locationChanged
Example:
on locationChanged
put mobileSensorReading("location", true) into theLocation
-- update the marker on the map showing the current location
updateMapPosition theLocation
end locationChanged
Parameters:
pLatitude:
the latitude of the device
pLongitude:
the longitude of the device
pAltitude:
the altitude of the device
Description:
Handle the <locationChanged> message if you want to perform tasks when
the location of the device changes.
The <locationChanged> message is sent to the current card of the default
stack when the location of the device changes.
If location tracking cannot be started (typically due to the user 'not
allowing' access to CoreLocation) then a <trackingError> message is sent
instead.
Changes:
In version 8.1 GPS behavior on iOS was changed to bring it inline with
the behavior on Android. On both platforms, the location reading
returned by the <mobileSensorReading> function is that which was sent
with the last system <locationChanged> event.
References: mobileSetLocationHistoryLimit (command),
mobileStopTrackingSensor (command), mobileStartTrackingSensor (command),
mobileGetLocationHistoryLimit (function),
mobileSensorAvailable (function), mobileSensorReading (function),
mobileLocationAuthorizationStatus (function), locationChanged (message),
trackingError (message)