private void Form1_Load(object sender, EventArgs e) { // Create a map control. MapControl map = new MapControl(); // Specify the map position on the form. map.Dock = DockStyle.Fill; // Add the map control to the window. this.Controls.Add(map); // Create an image tiles layer and add it to the map. ImageLayer tileLayer = new ImageLayer(); map.Layers.Add(tileLayer); // Create an Open Street data provider. OpenStreetMapDataProvider provider = new OpenStreetMapDataProvider(); tileLayer.DataProvider = provider; // Specify a template that is used to obtain image tiles. provider.TileUriTemplate = "http://{0}.tile.MyCustomOSMProvider.org/{1}/{2}/{3}.png"; provider.WebRequest += OnWebRequest; }
private void Form1_Load(object sender, EventArgs e) { // Create a map control. MapControl map = new MapControl(); // Specify the map position on the form. map.Dock = DockStyle.Fill; // Add the map control to the window. this.Controls.Add(map); // Create an image tiles layer and add it to the map. ImageLayer tilesLayer = new ImageLayer(); map.Layers.Add(tilesLayer); // Create an Open Street data provider. OpenStreetMapDataProvider provider = new OpenStreetMapDataProvider(); tilesLayer.DataProvider = provider; // Customize a local cache for storing image tiles obtained from the Open Street provider. provider.CacheOptions.DiskFolder = "C://MapTiles"; provider.CacheOptions.DiskExpireTime = new TimeSpan(01, 00, 00); provider.CacheOptions.MemoryLimit = 64; provider.CacheOptions.DiskLimit = 200; }
private void Form1_Load(object sender, EventArgs e) { // Create a map control. MapControl map = new MapControl(); // Specify the map position on the form map.Dock = DockStyle.Fill; // Create a layer. ImageLayer layer = new ImageLayer(); map.Layers.Add(layer); // Create a data provider. OpenStreetMapDataProvider provider = new OpenStreetMapDataProvider(); layer.DataProvider = provider; // Specify the map zoom level and center point map.ZoomLevel = 2; map.CenterPoint = new GeoPoint(38, -100); // Add the map control to the window. this.Controls.Add(map); }
private void FormHome_Load(object sender, EventArgs e) { // Create an image tiles layer and add it to the map. ImageLayer tilesLayer = new ImageLayer(); mapControl1.Layers.Add(tilesLayer); // Create an Open Street data provider. OpenStreetMapDataProvider provider = new OpenStreetMapDataProvider(); tilesLayer.DataProvider = provider; // Assign loaded data as data source for pie chart data adapter. pieChartDataAdapter1.DataSource = LoadData(filepath); }
public override MapImageDataProviderBase CreateMapDataProvider() { var provider = new OpenStreetMapDataProvider(); if (Kind.HasValue) { provider.Kind = Kind.Value; } provider.WebRequest += (s, e) => { e.UserAgent = "SpreadCommander"; }; return(provider); }
public SCMap AddOpenStreetImageLayer(OpenStreetMapKind kind, OpenStreetImageLayerOptions options = null) { options ??= new OpenStreetImageLayerOptions(); var provider = new OpenStreetMapDataProvider() { Kind = (DevExpress.XtraMap.OpenStreetMapKind)kind }; provider.WebRequest += (s, e) => { e.UserAgent = "SpreadCommander"; }; options.UpdateLayerImage(this, provider); return(this); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { // Create a map control. MapControl map = new MapControl(); // Create a layer. ImageTilesLayer layer = new ImageTilesLayer(); map.Layers.Add(layer); // Create a data provider. OpenStreetMapDataProvider provider = new OpenStreetMapDataProvider(); layer.DataProvider = provider; // Add the map control to the window. this.Content = map; }