Authored by Aleksejs Mjaliks

Merge branch 'clamp-zoom'

... ... @@ -480,8 +480,17 @@
return;
}
// clamp zoom to remain below or equal to maxZoom after zoomAfter will be applied
// Set targetZoom to maxZoom so the map zooms to its maximum
if(targetZoom > [self maxZoom]){
zoomFactor = exp2f([self maxZoom] - [self zoom]);
targetZoom = [self maxZoom];
}
// clamp zoom to remain above or equal to minZoom after zoomAfter will be applied
// Set targetZoom to minZoom so the map zooms to its maximum
if(targetZoom < [self minZoom]){
zoomFactor = 1/exp2f([self zoom] - [self minZoom]);
targetZoom = [self minZoom];
}
if ([self shouldZoomToTargetZoom:targetZoom withZoomFactor:zoomFactor])
... ...
... ... @@ -291,7 +291,12 @@
}
// clamp zoom to remain below or equal to maxZoom after zoomAfter will be applied
if(targetZoom > [self.contents maxZoom]){
_zoomFactor = exp2f([self.contents maxZoom] - [self.contents zoom]);
zoomFactor = exp2f([self.contents maxZoom] - [self.contents zoom]);
}
// clamp zoom to remain above or equal to minZoom after zoomAfter will be applied
if(targetZoom < [self.contents minZoom]){
zoomFactor = 1/exp2f([self.contents zoom] - [self.contents minZoom]);
}
//bools for syntactical sugar to understand the logic in the if statement below
... ...