public WmsSourceProvider(MapConfig config)
        {
            var        tileSize = new Size(config.TileSize);
            var        extent   = new Extent(config.Extent);
            Coordinate origin   = origin = new Coordinate(config.Origin);

            _tileGrid = CreateTileGrid(config.Resolutions, extent, origin, tileSize);
            _url      = config.Url;
            _paras    = config.UrlParas;
        }
Esempio n. 2
0
 public void RefreshTile(Vector3Int location, ITileGrid tileMap)
 {
     for (int yd = -1; yd <= 1; yd++)
     {
         for (int xd = -1; xd <= 1; xd++)
         {
             Vector3Int position = new Vector3Int(location.x + xd, location.y + yd, location.z);
             if (TileValue(tileMap, position))
             {
                 tileMap.RefreshTile(position);
             }
         }
     }
 }
Esempio n. 3
0
    private void UpdateTile(Vector3Int location, ITileGrid tileMap, ref ThreeDTileData tileData)
    {
        tileData.transform = Matrix4x4.identity;

        int mask = TileValue(tileMap, location + new Vector3Int(0, 1, 0)) ? (int)Neighbor.North : 0;        // North

        mask += TileValue(tileMap, location + new Vector3Int(1, 1, 0)) ? (int)Neighbor.NorthEast : 0;       // NorthEast
        mask += TileValue(tileMap, location + new Vector3Int(1, 0, 0)) ? (int)Neighbor.East : 0;            // East
        mask += TileValue(tileMap, location + new Vector3Int(1, -1, 0)) ? (int)Neighbor.SouthEast : 0;      // SouthEast
        mask += TileValue(tileMap, location + new Vector3Int(0, -1, 0)) ? (int)Neighbor.South : 0;          // South
        mask += TileValue(tileMap, location + new Vector3Int(-1, -1, 0)) ? (int)Neighbor.SouthWest : 0;     // SouthWest
        mask += TileValue(tileMap, location + new Vector3Int(-1, 0, 0)) ? (int)Neighbor.West : 0;           // West
        mask += TileValue(tileMap, location + new Vector3Int(-1, 1, 0)) ? (int)Neighbor.NorthWest : 0;      // NorthWest

        Debug.Log($"{(Neighbor)mask} ---- {mask}");

        byte original = (byte)mask;

        if ((original | 254) < 255)
        {
            mask = mask & 125;
        }
        if ((original | 251) < 255)
        {
            mask = mask & 245;
        }
        if ((original | 239) < 255)
        {
            mask = mask & 215;
        }
        if ((original | 191) < 255)
        {
            mask = mask & 95;
        }

        int index = GetIndex((byte)mask);

        if (index >= 0 && index < m_tileObjects.Length && TileValue(tileMap, location))
        {
            tileData.gameObject = m_tileObjects[index];
            tileData.transform  = GetTransform((byte)mask);
        }
    }
Esempio n. 4
0
    private bool TileValue(ITileGrid tileMap, Vector3Int position)
    {
        Tile tile = tileMap.GetTile(position);

        return(tile != null);
    }
Esempio n. 5
0
 public void GetTileData(Vector3Int location, ITileGrid tileMap, ref ThreeDTileData tileData)
 {
     UpdateTile(location, tileMap, ref tileData);
 }