wpf content in a layer

Sep 15, 2011 at 4:31 PM


Is it possible to add wpf UIElement ( grid for example with interactive content, not just visual of it ) positioned to scale on the map ?

I'm looking thru the code and I'm completely lost in it.

Help please...

Sep 15, 2011 at 9:30 PM

I suggest you create a ViewModel to hold your location and zoom level (I think some progress was made in this direction with map control but I use my own).

Use this VM to calculate the matrix transformation needed to reposition and scale your UIElement (you can do that in VM as well just be sure it fires property changed event).

Bind the RenderTransform of the UIElement to the matrix transformation.


Are there any specifics you're having issues with?


Sep 16, 2011 at 9:54 AM

Most specific issue (beside of my inexperience) is lack of any manual or some documentation.

Thx for putting me in direction. I try do do something like this , after I find a way to get location and zoom level ;

Sep 16, 2011 at 4:15 PM

Hi ludojad,

I don't understand your initial question. 'positioned to scale'? Is this something else than adding a grid with content next to the map?


Sep 19, 2011 at 8:20 AM
Edited Sep 19, 2011 at 8:34 AM

This grid could have same size all the time - like pinpoint, label or some description popup.

...or it could simulate some real object on map so it should react on zoom level change. I'm trying this version.

Sep 19, 2011 at 3:59 PM

Make a ViewModel that holds the properties you need (Resolution and Center). Whenever these are updated (NotifyPropertyChangedEvent) you can set the resolution and the center of the Map control (see SharpMap.View object - Resolution and Center properties). 

If you need you can handle the SharpMap.View.ViewChangedEvent to create a two way binding.

You can use resolution and center properties to create a matrix transformation to transform an UIElement to scale and move with the map (effectively becoming a part of the map).