Esempio n. 1
0
        private static void DownloadTile(object tile)
        {
            var parameters = (object[])tile;
            var tileInfo   = (TileInfo)parameters[0];
            var doneEvent  = (MultipleThreadResetEvent)parameters[1];
            var url        = ((WebTileProvider)_tileSource.Provider).Request.GetUri(tileInfo);
            var request    = new GZipWebClient();
            var bytes      = request.DownloadData(url);

            if (bytes != null)
            {
                var stream = new MemoryStream(bytes);
                Logger.Debug("Start parsing vector tile...");
                var layerInfos = VectorTileParser.Parse(stream);
                tiles[tileInfo] = layerInfos;
            }
            doneEvent.SetOne();
        }