Wpf – Designing a WPF map control

giswpf

I'm thinking about making a simple map control in WPF, and am thinking about the design of the basic map interface and am wondering if anyone has some good advice for this.

What I'm thinking of is using a ScrollViewer (sans scroll bars) as my "view port" and then stacking everything up on top of a canvas. From Z-Index=0 up, I'm thinking:

  1. Base canvas for lat/long calculations, control positioning, Z-Index stacking.
  2. Multiple Grid elements to represent the maps at different zoom levels. Using a grid to make tiling easier.
  3. Map objects with positional data.
  4. Map controls (zoom slider, overview, etc).
  5. Scroll viewer with mouse move events for panning and zooming.

Any comments suggestions on how I should be building this?

Best Answer

If you're looking for a good start, you can use the foundation of code supplied by the SharpMap project and build out from there. If I recall there were a few people already working on a WPF renderer for SharpMap, so you may also have some code to begin with.

I've personally used SharpMap in a C# 2.0 application that combined GIS data with real time GPS data, and it was very successful. SharpMap provided me the transformation suite to handle GIS data, along with the mathematical foundation to work with altering GIS information. It should be relatively straightforward to use the non-rendering code with a WPF frontend, as they already have presentation separated from the data.

(EDIT: added more details about how I used SharpMap)