Exemplo n.º 1
0
 private void OnDataError(UnityTile tile, Mapbox.Map.VectorTile vectorTile, TileErrorEventArgs e)
 {
     if (tile != null)
     {
         _tilesWaitingResponse.Remove(tile);
         if (tile.VectorDataState != TilePropertyState.Unregistered)
         {
             tile.SetVectorData(null);
             tile.VectorDataState = TilePropertyState.Error;
             OnErrorOccurred(e);
         }
     }
 }
 //TODO: change signature if 'VectorTile' class changes from 'sealed'
 //protected override void Dispose(bool disposeManagedResources)
 public void Dispose(bool disposeManagedResources)
 {
     if (!isDisposed)
     {
         if (disposeManagedResources)
         {
             //TODO implement IDisposable with Mapbox.VectorTile.VectorTile
             if (null != data)
             {
                 data = null;
             }
         }
     }
 }
        internal override bool ParseTileData(byte[] data)
        {
            try
            {
                var decompressed = Compression.Decompress(data);

                this.data = new VectorTile();

                return(true);
            }
            catch (Exception ex)
            {
                AddException(ex);
                return(false);
            }
        }
 private void OnVectorDataRecieved(UnityTile tile, Mapbox.Map.VectorTile vectorTile)
 {
     if (tile != null)
     {
         _tilesWaitingResponse.Remove(tile);
         if (tile.VectorDataState != TilePropertyState.Unregistered)
         {
             tile.SetVectorData(vectorTile);
             // FIXME: we can make the request BEFORE getting a response from these!
             if (tile.HeightDataState == TilePropertyState.Loading ||
                 tile.RasterDataState == TilePropertyState.Loading)
             {
                 tile.OnHeightDataChanged += DataChangedHandler;
                 tile.OnRasterDataChanged += DataChangedHandler;
             }
             else
             {
                 CreateMeshes(tile);
             }
         }
     }
 }