If direction = 253 Then colourstyle = "MyRotatingSymbolRenderer" end if Dim graphic As New Graphic() With { .Geometry = New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2))), .Symbol = TryCast(LayoutRoot.Resources(colourstyle), Symbol) }
Solved! Go to Solution.
But how can I pass that from code behind????
I don't see in your code where you initialize the attribute 'WIND_DIRECT'.
At first glance, if this attribute was initialized, it should work.
But how can I pass that from code behind????
colourstyle = "MyRotatingMarkerSymbol" Dim graphic As New Graphic() With { .Geometry = New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2))), .Symbol = TryCast(LayoutRoot.Resources(colourstyle), Symbol) } graphic.Attributes("WIND_DIRECT") =val2.value
I can Rotated an arrow with the code I mentioned above.
Is it possible to rotate a car icon with the same code?
I need to rotate the DefaultCArSymbol based on direction instead of MyRotatingMarkerSymbol. For that How can I write the code?Pls HELP ME
<!--'realtime code added-->
<esri:PictureMarkerSymbol x:Key="DefaultCArSymbol" OffsetX="8" OffsetY="8" Source="/ESRI-V-10-SIL4;component/Images/car-red-16x16.png" />
<esri:MarkerSymbol x:Name="MyRotatingMarkerSymbol" OffsetX="6" OffsetY="3">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Grid x:Name="ArrowGrid" RenderTransformOrigin="0.5,0.5" Background="Transparent" Width="6" Height="12">
<Path Data="M2.625,11.5 L0.5,9.375 L1.88125,9.375 L1.88125,0.5 L3.3687501,0.5 L3.3687501,9.375 L4.75,9.375 z"
Fill="#FFF4F4F5" Margin="0.625,0.25,0.625,0.625" Stretch="Fill" Stroke="Black" UseLayoutRounding="False"/>
<Grid.RenderTransform>
<CompositeTransform Rotation="{Binding Attributes[WIND_DIRECT]}" ScaleX="2" ScaleY="2" />
</Grid.RenderTransform>
</Grid>
</ControlTemplate>
</esri:MarkerSymbol.ControlTemplate>
</esri:MarkerSymbol>