Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
MapView.SetShowsUserLocation
Sets whether to show user location.
Component |
Version |
macOS |
Windows |
Linux |
Server |
iOS SDK |
MapView
|
9.0 |
✅ Yes
|
❌ No
|
❌ No
|
❌ No
|
✅ Yes
|
MBS( "MapView.SetShowsUserLocation"; MapView; Value )
More
MBS(
"MapView.SetShowsUserLocation"; /* Sets whether to show user location. */
$MapView; /* The map view reference number.e.g. $$MapView */
$Value) /* The new setting.
Pass 1 to enable or 0 to disable.e.g. 1 */
Less
Parameters
Parameter |
Description |
Example |
MapView |
The map view reference number. |
$$MapView |
Value |
The new setting.
Pass 1 to enable or 0 to disable. |
1 |
Result
Returns OK or error.
Description
Sets whether to show user location.
A Boolean value indicating whether the map should try to display the user’s location.
This property does not indicate whether the user’s position is actually visible on the map, only whether the map view should try to display it. Setting this property to 1 causes the map view to use the Core Location framework to find the current location and try to display it on the map. As long as this property is 1, the map view continues to track the user’s location and update it periodically. The default value of this property is 0.
Showing the user’s location does not guarantee that the location is visible on the map. The user might have scrolled the map to a different point, causing the current location to be offscreen. To determine whether the user’s current location is currently displayed on the map, use the MapView.IsUserLocationVisible function.
Examples
Create map view and show user location:
Set Variable [ $$MapView ; Value: MBS("MapView.CreateWithControl"; 0; "PlaceHolder") ]
Set Variable [ $r ; Value: MBS( "MapView.SetShowsUserLocation"; $$MapView; 1 ) ]
# may trigger dialog to ask for location permissions
See also
Example Databases
Created 14th January 2019, last changed 2nd January 2020
MapView.SetShowsTraffic
-
MapView.SetShowsZoomControls
Feedback: Report problem or ask question.