mapbox / mapbox/mapbox-maps-flutter
How to get puck location update timestamp?
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
We are using the following scripts to get current user location from mapbox
```
Future getPuckPosition() async {
Layer? layer;
if (Platform.isAndroid) {
layer = await getLayer("mapbox-location-indicator-layer");
} else {
layer = await getLayer("puck");
}
if (layer == null) {
return null;
}
final location = (layer as LocationIndicatorLayer).location;
if (location == null) {
return null;
}
final accuracy = (layer as LocationIndicatorLayer).accuracyRadius;
return Future.value(GeoLocator.Position(
latitude: location[0]!,
longitude: location[1]!,
timestamp: DateTime.now(),
accuracy: accuracy ?? 0,
altitude: 0,
heading: 0,
speed: 0,
speedAccuracy: 0,
));
}
}
```
It works as expected, however i would like to get when is the location updated within mapbox.
Is it possible to get this info for mapbox?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the getPuckPosition entry point and the LocationIndicatorLayer.location value shown in the issue. Check the Mapbox Flutter location API and related documentation for whether an update timestamp is exposed. Done means the supported way to obtain that timestamp is identified, or its absence and the required API change are clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100