OpenStreetMapDataProvider Class
The class that loads map images from a web resource that provides data in the OpenStreetMap format.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v18.1.dll
Declaration
Remarks
Before using map images in the OpenStreetMap format, please review the Copyright and License and Tile usage policy pages. To control which web resource should be used in your application as an OpenStreetMap data provider, you should assign a specific value for the OpenStreetMapDataProvider.TileUriTemplate property.
Example
This example demonstrates how to connect to the OpenStreetMap using the OpenStreetMapDataProvider object.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/xtramap-getting-started-lesson-2-connect-to-openstreetmap-e5070
using System;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraMap;
namespace ConnectToOpenStreet {
public partial class MainForm : XtraForm {
public MainForm() {
InitializeComponent();
}
#region #CreateOSMLayer
private void Form1_Load(object sender, EventArgs e) {
// Create an image layer and add it to the map.
mapControl.Layers.Add(new ImageLayer() {
// Create an OpenStreetMap data provider and assign it to the layer.
DataProvider = new OpenStreetMapDataProvider()
});
}
#endregion #CreateOSMLayer
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the OpenStreetMapDataProvider class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.