I've got a car (graphic) that I get a new location every second.
Is there an easy way to move the car smoothly on the map? rather than having the car move in a jerky type motion?
thanks,
If you want to update the location of a graphic you just need to apply a new geometry to it. This sample shows the basics.
This sample shows how you can do this with a 3D symbol.
If however your jerky movements are due to your point moving a large distance then you'll need to write some interpolation code to achieve this. You can work out interim points for a smooth motion by using Bresenham's line algorithm - Wikipedia which is pretty easy to implement if you are working in a projected coordinate system. I'm sure there are other alternatives you could try.
Does that help?
I had another flash of inspiration for working out interim points! It would be far easier if you did this:
- Take your old point and your new point and make them into a 2 point polyline
- Densify the line to the number of interim points you want. See GeometryEngine.desify
- Crack open the geometry to extract the points which make up the densified polyline
- Move the graphic to each interim point for a very short period of time (you'll need to experiment with this)
The above method would work with any spatial reference. Not such an exciting solution from a software engineering point of view, but much easier.