Tuesday, June 15, 2010

Think “Street Map control” means Google or Bing? Looking for something more “open?” How about a WPF control for OpenStreetMap.org?

CodeProject - WPF Map Control using openstreetmap.org Data

Introduction

This article will create a simple WPF control that enables browsing of map data from OpenStreetMap, as well as enabling searching for places and displaying the results on the map.

The attached zip file has both the source code, with documentation, and a sample application.

Background

I needed to allow the user to select various locations in my project but didn't want the user to have to install any other applications (such as Google Earth or Bing Maps 3D). One option was to have a web browser in my application pointing to the online versions, but this didn't feel right. Finally I looked at OpenStreetMap and was impressed by the maps, but couldn't find any controls to put it in my application.

What is OpenStreetMap?

From their Main Wiki page:

OpenStreetMap creates and provides free geographic data such as street maps to anyone who wants them. The project was started because most maps you think of as free actually have legal or technical restrictions on their use, holding back people from using them in creative, productive, or unexpected ways.

Basically, OpenStreetMap is a map made by the community for everybody to use. Also, luckily for me, all the details for the file naming conventions are there for creating our own control. All we have to do is download the relevant 256 x 256 pixel square image tiles for the area we want to look at and stitch them together - simple!

image…”

Having options, one of which is open, is good… This is a cool control that just seems to work.

Here’s a snap of the provided sample app;

image

 

Related Past Post XRef:
Microsoft Virtual Earth WinForm Control – Because I’m just a WinForm kind of guy…
Need to Geolocate an address? Get a Map image? Route something to somewhere? Need that as a WebServce? Virtual Earth Web Services SDK v1.0, built with WCF, has what you need…
MSR MapCruncher for Virtual Earth

Mix 09 Quick Video Link List

No comments: