Hey
I've been working with the WPF Map control pretty much non-stop since it was released a few days ago, and I thought now is a good time to bring up some thoughts / suggestions. Seen as the control is still in the development phase, I suppose they are more relevent now then they will be in a few months when everything is released.
What's great about the two map controls at the moment (Winform & WPF control) is that they are almost identical to work with. This means that if you can work with the one, it's easy to move to the other. Herein lies the problem.
If you want to draw a line with a custom style on the map (CreateSimpleLineStyle), you have a choice of the following parameters in the constructor:
GeoColor centerlineColor,
float centerlineWidth,
LineDashStyle centerlineDashStyle,
GeoColor innerLineColor,
float innerLineWidth,
LineDashStyle innerLineDashStyle,
GeoColor outerLineColor,
float outerLineWidth,
LineDashStyle outerLineDashStyle,
bool roundCap
What more could you want to do with a line?
Seems like we have quite a lot of options... and indeed there are. But in WPF we get far more that the ability to draw a line the way we did in GDI+. What if we wanted to put a radial gradient in the line? Give it a drop shadow? Add a trigger so that the line would grow and shrink ever so slightly to give it the effect that it was breathing?
Well in WPF, to add a gradient fill you would access the stroke property on the line... and add a RadialGradientBrush. Here's the XAML for a sample... which we could easily do in the code behind as well.
<line x1="<span" style="color: maroon;">
<line.stroke><radialgradientbrush.gradientstops>
</radialgradientbrush.gradientstops></line.stroke>
</line>
Line X1="10" Y1="10"
X2="50" Y2="50"
StrokeThickness="4"
Canvas.Left="100"
Line.Stroke
RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5"
RadialGradientBrush.GradientStops
GradientStop Color="Red" Offset="0" /
GradientStop Color="Blue" Offset="0.25" /
/RadialGradientBrush.GradientStops
/RadialGradientBrush
/Line.Stroke
/Line
[I removed the tags because they aren't wanting to be displayed]
<line x1="<span" style="color: maroon;">
<line.stroke><radialgradientbrush.gradientstops> </radialgradientbrush.gradientstops>
</line.stroke>
</line>
To get the growth effect we would add an EventTrigger to the Line's Triggers collection and change the stroke's width using a Double Animation. Also just a few lines of code.
With the service pack released, we can now write HLSL pixel shaders that we can add to our application. This means that we have access to hardware rendering to give us amazing effects. It takes one line to add a pixel shader to any WPF element (element.Effect = ...).
Take a look here: rakeshravuri.blogspot.com/2008/07/wave-reflection-shader-effect-in-wpf.html
We could add a waves to our oceans in the map even! Not that we'd want to... but we could, if we had access to those properties.
All of these things are easily possible... but only if we open up these properties on the underlying shapes that we add to the layer.
WPF's power comes packed in a few inherent pieces of functionality: Styling, Databinding and Animation. What we effectively have here in this WPF control (which is great so far... don't get me wrong) is a GDI port with none of what makes WPF powerful available to the user.
Is there something we can do to open up this control a little?