Alan1
April 29, 2009, 7:21pm
1
I have created an app that has vehicles drawn on the map and periodically I move the vehicles around according to updated lat/lon.
All works fine except I cannot figure out how to rotate the vehicle (pointShape in an InMemeoryFeature Layer) according to it's direction of travel.
Any sample code would help.
Alan
Ben
April 29, 2009, 10:27pm
2
Alan,
There is a property RotationAngle in PointStyle, you can rotate the point using that. Here is a demo for that, please have a look.
Thanks,
Ben
637-Demo.zip (10.9 KB)
Alan1
April 29, 2009, 10:51pm
3
That does work except that is rotates all features within the layer and I need to rotate each feature (PointShape) within the layer differently. Using that method I will need to create a new layer for every vehicle plotted. I need to plot 200+ vehicles. Alan
Alan1
April 30, 2009, 6:14am
4
Does this mean the Rotate(PointShape,Single) Method does not work or is not implemented?
Ben
May 5, 2009, 9:57am
5
Alan, You can create your own RotatePointStyle by inheriting the existing PointStyle, in the protected DrawCore method, you can rotate and render each feature differently with your own logic. In this way you only need one layer and still you can rotate every point with different angle. Thanks, Ben
Alan1
May 6, 2009, 8:44am
6
At the risk of sounding lazy! Do you have sample code?
Thanks Alan
Ben
May 8, 2009, 9:41am
7
Please have a look at a corresponding post here where you may be able to get some insights how to implement it. gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5698/afv/topic/afpgj/1/Default.aspx Thanks, Ben