Skip to content

Commit b41ae68

Browse files
authored
Fix scaling for world scale when zoom level was changed. (#668)
1 parent 9910e1b commit b41ae68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdkproject/Assets/Mapbox/Unity/Map/AbstractMap.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public class MapScalingAtWorldScaleStrategy : IMapScalingStrategy
2626
{
2727
public void SetUpScaling(AbstractMap map)
2828
{
29-
map.SetWorldRelativeScale(Mathf.Cos(Mathf.Deg2Rad * (float)map.CenterLatitudeLongitude.x));
29+
var scaleFactor = Mathf.Pow(2, (map.AbsoluteZoom - map.InitialZoom));
30+
map.SetWorldRelativeScale(scaleFactor * Mathf.Cos(Mathf.Deg2Rad * (float)map.CenterLatitudeLongitude.x));
3031
}
3132
}
3233

0 commit comments

Comments
 (0)