static MapWindowManager() { GlobalSettings gs = new GlobalSettings(); if (Global.Settings?.BingAPIKey.Length > 0) { gs.BingApiKey = Global.Settings.BingAPIKey; } TileProviders.Add(0, "OpenStreetMap"); TileProviders.Add(1, "OpenCycleMap"); TileProviders.Add(2, "OpenTransportMap"); if (Global.Settings?.BingAPIKey.Length > 0) { TileProviders.Add(3, "BingMaps"); TileProviders.Add(4, "BingSatellite"); TileProviders.Add(5, "BingHybrid"); } TileProviders.Add(6, "GoogleMaps"); //TileProviders.Add(7, "GoogleSatellite"); //TileProviders.Add(8, "GoogleHybrid"); TileProviders.Add(9, "GoogleTerrain"); //TileProviders.Add(10, "HereMaps"); //TileProviders.Add(11, "HereSatellite"); //TileProviders.Add(12, "HereHybrid"); //TileProviders.Add(13, "HereTerrain"); //TileProviders.Add(21, "Rosreestr"); TileProviders.Add(22, "OpenHumanitarianMap"); //TileProviders.Add(23, "MapQuestAerial"); }
private void Main_Load(object sender, EventArgs e) { map1.Projection = tkMapProjection.PROJECTION_WGS84; TileProviders providers = map1.Tiles.Providers; //int providerId = (int)tkTileProvider.ProviderCustom + 1; // (1024 + 1) should be unique across application runs in case disk caching is used providers.Add( 1025, "矢量", "http://webgis.591map.net/tiler/tdt-vec_w-{switch:1,2,3,4,5,6}-{x}-{y}-{zoom}.html", 0, 1, 19); providers.Add( 1026, "影像", "http://webgis.591map.net/tiler/tdt-img_w-{switch:1,2,3,4,5,6}-{x}-{y}-{zoom}.html", 0, 1, 19); map1.Tiles.ProviderId = 1025;// = tkTileProvider.ProviderCustom; map1.KnownExtents = tkKnownExtents.keChina; map1.Refresh(); }
private void bunifuFlatButton2_Click(object sender, EventArgs e) { try { providers = MainMap.Tiles.Providers; providerid = (int)tkTileProvider.ProviderCustom + 102; providers.Add(providerid, "GoogleTransit", "http://127.0.0.1/GoogleTransit/z{zoom}/{y}/{x}.png", tkTileProjection.SphericalMercator, 0, 20); MainMap.Tiles.ProviderId = providerid; } catch { MessageBox.Show("The server was not found"); return; } }
public bool AddCustom(int id, string name, string urlPattern, TileProjection projection, int minZoom = 0, int maxZoom = 17) { return(_providers.Add(id, name, urlPattern, (tkTileProjection)projection, minZoom, maxZoom)); }