Show Current Location¶
To display the user's current location on the map, your application must first request and obtain location permissions from the user.
Show/Hide Current Location On Map¶
Use this functionality to enable or disable the display of the user's current location on the map by controlling the visibility of the Location Component.
MapplsMap(
initialCameraPosition: _kInitialPosition,
myLocationEnabled: true,
)
Location Update Callback¶
To request continuous location update
MapplsMap(
initialCameraPosition: _kInitialPosition,
myLocationEnabled: true,
onUserLocationUpdated: (location) => {
print("Position: ${location.position.toString()}, Speed: ${location.speed}, Altitude: ${location.altitude}")
}, )
Tracking Mode¶
Contains the variety of camera modes which determine how the camera will track the user location.
MapplsMap(
initialCameraPosition: _kInitialPosition,
myLocationEnabled: true,
myLocationTrackingMode: MyLocationTrackingMode.none,
)
Following are the possible values for MyLocationTrackingMode:
1. MyLocationTrackingMode.none: No camera tracking.
2. MyLocationTrackingMode.tracking: Camera tracks the device location, no bearing is considered.
3. MyLocationTrackingMode.trackingCompass: Camera tracks the device location, tracking bearing provided by the device compass.
4. MyLocationTrackingMode.trackingGps: Camera tracks the device location, with bearing provided by a normalized Location#getBearing().
Note: On Slide the Map or if we call any Camera Controls Function then the Tracking Mode is set to
MyLocationTrackingMode.none
Render Mode¶
Contains the variety of ways the user location can be rendered on the map.
MapplsMap(
initialCameraPosition: _kInitialPosition,
myLocationEnabled: true,
myLocationRenderMode: MyLocationRenderMode.normal,
)
Following are the possible values for MyLocationRenderMode:
1. MyLocationRenderMode.normal: This mode shows the device location, ignoring both compass and GPS bearing (no arrow rendered).
2. MyLocationRenderMode.compass: This mode shows the device location, as well as an arrow that is considering the compass of the device.
3. MyLocationRenderMode.gps: This mode shows the device location with the icon bearing updated from the Location updates being provided to the LocationComponent.
For any queries and support, please contact:
Email us at apisupport@mappls.com
Support
Need support? contact us!
