Exemplo n.º 1
0
 public GoogleTileSource(GoogleRequest request, IPersistentCache<byte[]> persistentCache = null)
 {
     _tileSchema = new SphericalMercatorInvertedWorldSchema();
     _tileProvider = new WebTileProvider(request, persistentCache, 
         // The Google requests needs to fake the UserAgent en Referer.
         uri =>
             {
                 var httpWebRequest = (HttpWebRequest) WebRequest.Create(uri);
                 httpWebRequest.UserAgent = UserAgent;
                 httpWebRequest.Referer = Referer;
                 return httpWebRequest;
             });
 }
Exemplo n.º 2
0
 private void button7_Click(object sender, EventArgs e)
 {
     ITileSchema schema = new SphericalMercatorInvertedWorldSchema();
     ILayer[] layers = CreateLayers();
     SharpMapTileSource source = new SharpMapTileSource(schema, layers);
     TileAsyncLayer osmLayer = new TileAsyncLayer(source, "TileLayer - SharpMap");
     this.mapBox1.Map.BackgroundLayer.Clear();
     this.mapBox1.Map.BackgroundLayer.Add(osmLayer);
     this.mapBox1.Refresh();
 }