Location indicator
Enabling user location indicator will render a view on the map that shows the device's current location.
Enable the default user location indicator using the following code:
mapView.userTrackingMode = .follow // or .followWithHeading
Change view style
To customize the appearance of the location indicator use UserLocationViewStyles
mapView.userLocationManager.userLocationViewStyles = .init(
normal: .init(
foregroundColor: .green,
backgroundColor: .white,
headingColor: .red
),
stale: .init(
foregroundColor: .brown,
backgroundColor: .white,
headingColor: .cyan
),
outOfActiveLevelOpacity: 0.4,
accuracyColor: .green,
accuracyAlpha: 0.2,
pulseEnabled: true,
pulseColor: .magenta,
pulseAlpha: 0.3
)
Examples
For additional examples and sample implementations of WemapSDKs, visit the official GitHub repository.
Clone the repository and follow the README instructions to run the sample application.