[TASK] Initial commit with basic product setup
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Mapbox.Unity.Map.Interfaces;
|
||||
using Mapbox.Unity.Utilities;
|
||||
|
||||
namespace Mapbox.Unity.Map.Strategies
|
||||
{
|
||||
public class MapPlacementAtLocationCenterStrategy : IMapPlacementStrategy
|
||||
{
|
||||
public void SetUpPlacement(AbstractMap map)
|
||||
{
|
||||
map.SetCenterMercator(Conversions.LatLonToMeters(map.CenterLatitudeLongitude));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d44d0606bd83495bab6d3da0a48ad090
|
||||
timeCreated: 1538658271
|
||||
@@ -0,0 +1,15 @@
|
||||
using Mapbox.Map;
|
||||
using Mapbox.Unity.Map.Interfaces;
|
||||
using Mapbox.Unity.Utilities;
|
||||
|
||||
namespace Mapbox.Unity.Map.Strategies
|
||||
{
|
||||
public class MapPlacementAtTileCenterStrategy : IMapPlacementStrategy
|
||||
{
|
||||
public void SetUpPlacement(AbstractMap map)
|
||||
{
|
||||
var referenceTileRect = Conversions.TileBounds(TileCover.CoordinateToTileId(map.CenterLatitudeLongitude, map.AbsoluteZoom));
|
||||
map.SetCenterMercator(referenceTileRect.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 559d97f03cf14bf79a007b09ad4f1336
|
||||
timeCreated: 1538658263
|
||||
@@ -0,0 +1,15 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f52911bb8a44f60a4ef4feb3602d386
|
||||
timeCreated: 1538658244
|
||||
@@ -0,0 +1,14 @@
|
||||
using Mapbox.Unity.Map.Interfaces;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Mapbox.Unity.Map.Strategies
|
||||
{
|
||||
public class MapScalingAtWorldScaleStrategy : IMapScalingStrategy
|
||||
{
|
||||
public void SetUpScaling(AbstractMap map)
|
||||
{
|
||||
var scaleFactor = Mathf.Pow(2, (map.AbsoluteZoom - map.InitialZoom));
|
||||
map.SetWorldRelativeScale(scaleFactor * Mathf.Cos(Mathf.Deg2Rad * (float)map.CenterLatitudeLongitude.x));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc8da5d9c56144fc8758276cc931710e
|
||||
timeCreated: 1538658236
|
||||
Reference in New Issue
Block a user