-
-
Notifications
You must be signed in to change notification settings - Fork 894
Open
Labels
Description
What do you want implemented?
Say the user stops zooming and they are VERY CLOSE to a higher resolution set of tiles. You can set a small threshold say within 0.10 of the clamped zoom level, and if they are within that small range after they are done zooming, "snap" to the higher zoom. It could default to off but allow use to enable and set the threshold value.
For example, I do this in my onPositionChanged:
stopOpcAutoZoomTimer();
if (zoomingMap) {
_opcAutoZoomTimer = Timer(Duration(milliseconds: 64), () async {
double maxZoomLevel = 10;
// Snaps to nearby higher-res zoom level if close enough
for (double level = 4; level <= maxZoomLevel; level++) {
double threshold = level + 0.5;
if (mapState.zoom > threshold - 0.1 && mapState.zoom < threshold) {
stopPositionChangedTimer();
mapState.move(
LatLng(centerPosition.latitude, centerPosition.longitude), threshold);
break;
}
}
});
}
Not sure what optimal timer duration would be, but you could leave it up to the user.
What other alternatives are available?
No response
Can you provide any other information?
No response