Ejemplo n.º 1
0
 public TileController(IMapDataStore dataStore, Stylesheet stylesheet,
                       ElevationDataType elevationDataType, GeoCoordinate origin, int levelOfDetail)
 {
     _dataStore         = dataStore;
     _stylesheet        = stylesheet;
     _elevationDataType = elevationDataType;
     _geoOrigin         = origin;
     _levelOfDetail     = levelOfDetail;
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public void Configure(IConfigSection configSection)
        {
            _osmMapDataProvider.Configure(configSection);
            _mapzenMapDataProvider.Configure(configSection);

            _srtmElevationDataProvider.Configure(configSection);
            _mapzenElevationDataProvider.Configure(configSection);

            _eleDataType = (ElevationDataType)configSection.GetInt("data/elevation/type", 2);
        }
Ejemplo n.º 3
0
        protected TileController(IMapDataStore dataStore, Stylesheet stylesheet, ElevationDataType elevationType,
                                 Transform pivot, Range <int> lodRange)
        {
            _dataStore     = dataStore;
            _stylesheet    = stylesheet;
            _elevationType = elevationType;

            Pivot    = pivot;
            LodRange = lodRange;
        }
Ejemplo n.º 4
0
        public SurfaceTileController(IMapDataStore dataStore, Stylesheet stylesheet, ElevationDataType elevationType,
                                     Transform pivot, Range <int> lodRange, GeoCoordinate origin, float scale, float maxDistance) :
            base(dataStore, stylesheet, elevationType, pivot, lodRange)
        {
            _scale     = scale;
            _geoOrigin = origin;

            LodTree    = GetLodTree(pivot.Find("Camera").GetComponent <Camera>().aspect, maxDistance);
            Projection = CreateProjection();

            HeightRange = new Range <float>(LodTree.Min, LodTree.Max);
            ResetToDefaults();
        }
Ejemplo n.º 5
0
        /// <summary> Creates <see cref="Tile"/>. </summary>
        /// <param name="quadKey"></param>
        /// <param name="stylesheet"></param>
        /// <param name="projection"> Projection. </param>
        /// <param name="elevationType"> Elevation type. </param>
        /// <param name="gameObject"> Tile gameobject. </param>
        public Tile(QuadKey quadKey, Stylesheet stylesheet, IProjection projection,
                    ElevationDataType elevationType, GameObject gameObject = null)
        {
            QuadKey       = quadKey;
            Stylesheet    = stylesheet;
            Projection    = projection;
            ElevationType = elevationType;
            GameObject    = gameObject;

            BoundingBox = GeoUtils.QuadKeyToBoundingBox(quadKey);

            CancelationToken = new CancellationToken();
        }
Ejemplo n.º 6
0
        public SphereTileController(IMapDataStore dataStore, Stylesheet stylesheet, ElevationDataType elevationType,
                                    Transform pivot, Range <int> lodRange, float radius) :
            base(dataStore, stylesheet, elevationType, pivot, lodRange)
        {
            _radius = radius;

            LodTree     = GetLodTree();
            FieldOfView = 60;
            Projection  = new SphericalProjection(radius);

            _camera = pivot.Find("Camera").transform;

            HeightRange = new Range <float>(LodTree.Min, LodTree.Max);
            ResetToDefaults();
        }
Ejemplo n.º 7
0
        /// <inheritdoc />
        public void Configure(IConfigSection configSection)
        {
            var stringPath  = _pathResolver.Resolve(configSection.GetString("data/index/strings"));
            var mapDataPath = _pathResolver.Resolve(configSection.GetString("data/index/spatial"));

            _eleDataType = (ElevationDataType)configSection.GetInt("data/elevation/type", 0);

            string errorMsg = null;

            CoreLibrary.Configure(stringPath, mapDataPath, error => errorMsg = error);
            if (errorMsg != null)
            {
                throw new MapDataException(errorMsg);
            }
        }
Ejemplo n.º 8
0
 public ConfigBuilder SetElevationType(ElevationDataType type)
 {
     Add <int>(@"data/elevation/type", (int)type);
     return(this);
 }
Ejemplo n.º 9
0
 /// <summary> Gets elevation for given coordinate using specific elevation data. </summary>
 /// <returns> Height under sea level. </returns>
 /// <remarks> Elevation data should be present on disk. </remarks>
 public static double GetElevation(QuadKey quadKey, ElevationDataType elevationDataType, GeoCoordinate coordinate)
 {
     return(getElevation(quadKey.TileX, quadKey.TileY, quadKey.LevelOfDetail,
                         (int)elevationDataType, coordinate.Latitude, coordinate.Longitude));
 }
Ejemplo n.º 10
0
 /// <inheritdoc />
 public void Configure(IConfigSection configSection)
 {
     _eleDataType = (ElevationDataType)configSection.GetInt("data/elevation/type", 0);
 }
Ejemplo n.º 11
0
 /// <summary> Loads quadkey. </summary>
 /// <param name="stylePath"> Stylesheet path. </param>
 /// <param name="quadKey"> QuadKey</param>
 /// <param name="elevationDataType"> Elevation data type.</param>
 /// <param name="onMeshBuilt"></param>
 /// <param name="onElementLoaded"></param>
 /// <param name="onError"></param>
 public static void LoadQuadKey(string stylePath, QuadKey quadKey, ElevationDataType elevationDataType,
                                OnMeshBuilt onMeshBuilt, OnElementLoaded onElementLoaded, OnError onError)
 {
     loadQuadKey(stylePath, quadKey.TileX, quadKey.TileY, quadKey.LevelOfDetail,
                 (int)elevationDataType, onMeshBuilt, onElementLoaded, onError);
 }