|
|
|
|
|
- Special cases
- Required permissions
- Required application feature
GPSDetectPosition (Function) In french: GPSDétectePosition Asks to be notified when the device gets close to a given location. // Enable the notification request GPSDetectPosition(DetectionProc, 1.145258, 30.968745)
// Procedure called during the notification PROCÉDURE DetectionProc(Enter is boolean) IF Enter = True THEN Info("You have reached your destination.") END
Syntax
<Result> = GPSDetectPosition(<WLanguage procedure> , <Latitude> , <Longitude> [, <Radius> [, <Timeout>]])
<Result>: Integer Detection identifier. This identifier is used in the following cases: - to stop the notification mechanism. Simply pass this identifier as a parameter to GPSStopDetection.
- to identify the location processed in the WLanguage procedure called (case where the same WLanguage procedure is used to process several locations).
<WLanguage procedure>: Procedure name Name of the WLanguage procedure ("callback" procedure) called when the device enters into or exits from the region delimited by the specified parameters. <Latitude>: Real Latitude of the proximity location. <Longitude>: Real Longitude of the proximity location. <Radius>: Optional real Radius (in meters), around the proximity location, from which the notification is to be generated. If this parameter is not specified, the radius around the location will be set to 50 meters. <Timeout>: Optional integer or optional Duration Timeout (in hundredths of a second) of the proximity alert. This timeout starts from the call to the function. - No timeout will be defined if this parameter is set to -1 or if it is not specified.
- If this timeout is specified, the notification mechanism will automatically stop at the end of the timeout.
This parameter can correspond to: - an integer corresponding to the number of hundredths of a second,
- a Duration variable,
- the duration in a readable format (e.g., 1 s or 10 ms).
Remarks Special cases - To stop receiving notifications, use GPSEnd.
- To stop detecting the proximity of a specific location;
- return False in the associated WLanguage procedure,
- use the GPSStopDetection function.
- You can detect the proximity to multiple locations by calling GPSDetectPosition for each location. If the same procedure is called for several locations, it is possible to differentiate these locations in the WLanguage procedure with the <Detection identifier> parameter. This parameter corresponds to the result of GPSDetectPosition.
- Location measurements can be more or less accurate depending on the parameters of the location provider. Therefore, it may happen that no notification is sent if the device briefly passes near the monitored area. Similarly, a notification may be received if the device comes very close to the monitored area without entering it.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|