예제 #1
0
        public GOTileObj(Vector2 tileCoordinates, int zoomLevel, GoMap.GOMap.GOMapType mapType, bool useElevation, float elevationMultiplier, Vector2 resolution,
                         bool useCache, bool addGofeatureComponents, float worldScale, bool useSatelliteBackground, bool satellite4X, bool combineFeatures, GONavMeshSettings navmeshSettings)
        {
            this.tileCoordinates        = tileCoordinates;
            this.zoomLevel              = zoomLevel;
            this.useElevation           = useElevation;
            this.elevationMultiplier    = elevationMultiplier;
            this.resolution             = resolution;
            this.useCache               = useCache;
            this.mapType                = mapType;
            this.elevationType          = MapTypeToElevationType(mapType);
            this.addGoFeatureComponents = addGofeatureComponents;
            this.worldScale             = worldScale;
            this.useSatelliteBackground = useSatelliteBackground;
            this.satellite4X            = satellite4X;
            this.combineFeatures        = combineFeatures;
            this.navmeshSettings        = navmeshSettings;

            tileCenter = new Coordinates(tileCoordinates, zoomLevel);
            tileOrigin = tileCenter.tileOrigin(zoomLevel).convertCoordinateToVector();

            diagonalLenght = tileCenter.diagonalLenght(zoomLevel);

            name = tileCoordinates.x + "-" + tileCoordinates.y + "-" + zoomLevel;

            Vector3[] vs = tileCenter.tileVertices(zoomLevel).ToArray();
            vertices = vs.ToList();

            float tileHeight = Vector3.Distance(vertices [0], vertices [1]);
            float tileWidth  = Vector3.Distance(vertices [1], vertices [2]);

            this.tileSize = new Vector2(tileWidth, tileHeight);
        }
예제 #2
0
        public static GOElevationAPI MapTypeToElevationType(GoMap.GOMap.GOMapType mapType)
        {
            switch (mapType)
            {
            case GOMap.GOMapType.Mapzen_Legacy:
                return(GOElevationAPI.Mapzen);

            case GOMap.GOMapType.Mapbox:
                return(GOElevationAPI.Mapbox);
            }

            return(GOElevationAPI.Mapzen);
        }