[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,33 @@
namespace Mapbox.Unity.Map
{
using System.Collections;
using Mapbox.Unity.Location;
using UnityEngine;
public class InitializeMapWithLocationProvider : MonoBehaviour
{
[SerializeField]
AbstractMap _map;
ILocationProvider _locationProvider;
private void Awake()
{
// Prevent double initialization of the map.
_map.InitializeOnStart = false;
}
protected virtual IEnumerator Start()
{
yield return null;
_locationProvider = LocationProviderFactory.Instance.DefaultLocationProvider;
_locationProvider.OnLocationUpdated += LocationProvider_OnLocationUpdated; ;
}
void LocationProvider_OnLocationUpdated(Unity.Location.Location location)
{
_locationProvider.OnLocationUpdated -= LocationProvider_OnLocationUpdated;
_map.Initialize(location.LatitudeLongitude, _map.AbsoluteZoom);
}
}
}