iOS Native - Location indicator
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:
map.userTrackingMode = .followWithHeading
Change view style
There are several options to customize the appearance of the location indicator using UserLocationStyle
.
By modifying colors of default
userLocationViewStyle
:map.userLocationManager.userLocationViewStyle = .init(
foregroundTintColor: .systemPink,
backgroundTintColor: .black,
headingTintColor: .green,
outOfActiveLevelStyle: .init(
foregroundTintColor: .darkGray,
headingTintColor: .red,
alpha: 0.5
)
)By modifying images of default
userLocationViewStyle
:let foreground = UIImage(named: "UserPuckIcon")
let heading = UIImage(named: "UserArrow")
map.userLocationManager.userLocationViewStyle = .init(
foregroundImage: foreground,
backgroundImage: UIImage(named: "UserIcon"),
headingImage: heading,
outOfActiveLevelStyle: .init(
foregroundImage: foreground,
headingImage: heading
)
)
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.