[TASK] Initial commit with basic product setup

This commit is contained in:
2019-08-18 13:50:14 +02:00
commit 01a66a8e1f
2548 changed files with 167528 additions and 0 deletions

View File

@@ -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));
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d44d0606bd83495bab6d3da0a48ad090
timeCreated: 1538658271

View File

@@ -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);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 559d97f03cf14bf79a007b09ad4f1336
timeCreated: 1538658263

View File

@@ -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));
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6f52911bb8a44f60a4ef4feb3602d386
timeCreated: 1538658244

View File

@@ -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));
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: cc8da5d9c56144fc8758276cc931710e
timeCreated: 1538658236