Blue Dot
Displaying user position inside a building is not accurate with just GPS. However, there are Indoor Positioning Systems (IPS) utilizing different technological approaches to providing an accurate and reliable positioning indoors. Mappedin works with any IPS capable of providing the SDK with latitude, longitude and floor level information.
Display the Blue Dot
You can initialize and enable the Blue Dot in the firstMapLoaded
-callback. To display a Blue Dot with the SDK, you'll need the position information. The following is a point in the fictional Mappedin Demo Mall with an accuracy of 2 meter radius on the floor level 0
.
val coords = MPIPosition.MPICoordinates(43.52012478635707, -80.53951744629536, 2.0, 0)
The blueDotManager
is first initialized with default settings. You could set the Blue Dot base color and other properties here.
mapView.blueDotManager.enable(MPIOptions.BlueDot())
Using our sample coordinate, we can no draw it on the map with the following complete snippet. updatePosition
should be called whenever you receive a new position update from the operating system or third-party IPS.
override fun onFirstMapLoaded() {
mapView.blueDotManager.enable(MPIOptions.BlueDot())
val coords = MPIPosition.MPICoordinates(43.52012478635707, -80.53951744629536, 2.0, 0)
val position = MPIPosition(1.0, coords)
mapView.blueDotManager.updatePosition(position);
}