Blue Dot

Displaying user position inside a building is not accurate with just GPS. However, there are a multitude of Indoor Positioning Systems utilizing different technological approaches to providing an accurate and reliable positioning inside. Mappedin works with any IPS capable of providing the SDK with latitude, longitude and floor level information.

Enabling Blue Dot

You can initialize and enable the Blue Dot when the map first loads by using the onFirstMapLoaded-function implemented by MPIMapViewDelegate. The MPIBlueDotManager can be easily enabled with default settings by calling mapView.blueDotManager.enable(MPIOptions.BlueDot()).

There are two useful events to listen to: position update and state change. For debugging purposes, you could add print statements to the following functions. Position updates could be useful for reacting to a user entering or leaving a certain radius of a store. Status updates help handle situations where the position is no longer available.

override fun onFirstMapLoaded() {
mapView.blueDotManager.enable(MPIOptions.BlueDot())
}
override fun onBlueDotPositionUpdate(update: MPIBlueDotPositionUpdate) {
Log.d("Position", update.position.toString())
}
override fun onBlueDotStateChange(stateChange: MPIBlueDotStateChange) {
Log.d("Name", stateChange.name.toString())
Log.d("Reason", stateChange.reason.toString())
}

Simulating Blue Dot

To display a Blue Dot with the SDK, you'll need the position information in the form of MPICoordinates. 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)

Using our sample coordinate, we can draw the Blue Dot on the map by creating an MPIPosition and passing it to blueDotManager.updatePosition().

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)
}

Android Blue Dot

Was this page helpful?