You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mapbox-sdk/Unity/Map/Strategies/MapScalingAtUnityScaleStrat...

16 lines
487 B

1 year ago
using Mapbox.Map;
using Mapbox.Unity.Map.Interfaces;
using Mapbox.Unity.Utilities;
namespace Mapbox.Unity.Map.Strategies
{
public class MapScalingAtUnityScaleStrategy : IMapScalingStrategy
{
public void SetUpScaling(AbstractMap map)
{
var referenceTileRect = Conversions.TileBounds(TileCover.CoordinateToTileId(map.CenterLatitudeLongitude, map.AbsoluteZoom));
map.SetWorldRelativeScale((float)(map.Options.scalingOptions.unityTileSize / referenceTileRect.Size.x));
}
}
}