Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
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
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
Blog Entries
FileMaker Magazin
Created 14th January 2019, last changed 2nd January 2020