WinForms Map Control (coming in 13.1)

As we near release I thought I would show you another WinForms gem we are adding in 13.1: the WinForms Map Control. When it comes to data analysis the key to understanding is the concise display of many dimensions. A map allows you to convey locality in a truly unparalleled way. This sample represents the top 25 US airports (zoomed into the New York/New Jersey area):

WinForms Map Control

Adding a Map to your WinForms project is a simple drag and drop operation. Once the control is on your Form, you can add an Image Layer from either Bing or OpenStreet (the example above is OpenStreet). You can additionally add any number of vector layers from either a file (KML, SHP supported), from a database, or directly in code.

WinForms Map Control Layers

For this example I used our soon-to-be-released Spreadsheet API to load a csv file of airport locations directly into the map:

var layer = (VectorItemsLayer)mapControl1.Layers[1];

Workbook workbook = new Workbook();
workbook.LoadDocument("airports.csv");

Worksheet sheet = workbook.Worksheets.ActiveWorksheet;

for (int i = 1; i <= sheet.Rows.LastUsedIndex; i++)
{
    string code = sheet[i, 0].DisplayText;
    double lat = sheet[i, 1].Value.NumericValue;
    double lng = sheet[i, 2].Value.NumericValue;

    MapPushpin pushpin = new MapPushpin { Location = new GeoPoint(lat, lng), ToolTipPattern = code };
    layer.Items.Add(pushpin);
}

mapControl1.ZoomLevel = 4.5;
mapControl1.CenterPoint = new GeoPoint(37.50, -98.35);

The code simply loads the csv file and creates pusphins for each airport represented in the data. Since these are only US airports, I zoom in and center the map using the ZoomLevel and CenterPoint properties in the map. Aside from the pushpin, there are a number of other map elements that can be added including Dots, Rectangles, Polygons, Paths, and even a Custom Element:

WinForms Map Control Map Elements

We are tremendously excited for the great crop of things coming during our 13.1 series of releases.

As always, if there are any comments and/or questions, feel free to get a hold of me!

Seth Juarez
Email: sethj@devexpress.com
Twitter: @SethJuarez

Free DevExpress Products – Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We’ll be happy to follow-up.
Geert Depickere
Geert Depickere

Another great component that "finds its way" to WinForms :-)

13 May 2013
George Papadakis
George Papadakis

I believe that i am the happiest developer in Devxpress Comnunity. The last 7 years i develop gis applications using your components. This is Christmas before Christmas.

13 May 2013
Mark Couvaras
Mark Couvaras

Well done DevExpress!!! I completely agree with George Papadakis about it being Christmas. You guys keep making Winforms more and more fun which says a lot about your skills and dedication to the product. Keep up the good work Seth and team

14 May 2013
Torsten Reuter
Torsten Reuter

Excellent! This is great news.

14 May 2013
Michael_Hachen
Michael_Hachen

Great news!

I guess I need a api key to use Bing Maps, right?

15 May 2013
Chris Royle (LOB)
Chris Royle (LOBS)

Are there any facilities for address resolution / route calculation ?

16 May 2013
Alan (DevExpress)
Alan (DevExpress)

Hi Michael,

Yes, to use the Bing Maps data provider you need to obtain the Bing key. For instructions, please refer to help.devexpress.com

16 May 2013
Alan (DevExpress)
Alan (DevExpress)

Hi Chris,

In the first version there is no support for route calculation, but we are planning to add this functionality in the future.

16 May 2013
Michael_Hachen
Michael_Hachen

Hi Alan

Thanks for the link!

28 May 2013
Fmonteiro
Fmonteiro

For Route there is a good service "onTerra", returns you the best route, then use the Bing REST Service to calculate the route (points) and then fill them with Polyline into MapControl. ufffff Give some work but Works!

7 October 2013

Please login or register to post comments.