Select to view content in your preferred language

Problem with Rotation of a MarkerSymbol

2342
1
08-11-2011 07:47 AM
AaronBishop
New Contributor
Hi,

We are working on an Esri silverlight application (latest versions) -- and are having a problem with how the rotation of a MarkerSymbol works.  Basically, the application is a fleet tracking system, where each vehicle has its coordinates reported in real time, along with the direction the vehicle is facing.

We have a GraphicsLayer that contains all of the vehicle symbols, and the symbol has its rotation set using something like...

<Image RenderTransformOrigin="0.5,0.5" Source="{Binding Attributes[ImageLoc]}">
    <Image.RenderTransform>
        <RotateTransform Angle="{Binding Attributes[Heading]}"/>
    </Image.RenderTransform>
</Image>

and...

graphic.Attributes["Heading"] = heading;



That works well, and the units are displayed on the map correctly.  However, when the application tries to adjust the positions of the vehicles (which happens every second, let's say) -- it does so by creating a new GraphicsLayer, and filling it with a symbol for each vehicle.  The old layer is then removed and the new layer takes its place.

Again -- that works well, except there is a 1 frame flicker -- where all vehicles are drawn pointing Northwards instead of their correct orientation.  Does anyone have any advice on how to get this working without that flicker?

Thanks,
-Aaron


PS -- we have tried this several other ways...  Having a single layer and adjusting the heading of existing markers does not flicker -- however it takes a long time (1 second or so) -- guessing because it redraws after each marker is updated or something along those lines.
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
The rotatetransform angle binding kicks in after the symbol has been first displayed (so without any rotation). Then the binding kicks in and the symbol is rotated --> flicking effect.

One possible workaround is to use a surrogate binder attached property instead of a transform binding.
You will find a sample with the kmllayer of the ArcGIS WinPhone toolkit (since WinPhone doesn't support transform bindings).

I attached the 2 interesting files.
0 Kudos