This project has moved. For the latest updates, please go here.

Tracking Layer

Topics: General Topics
Nov 21, 2006 at 9:58 AM

I create a tracking layer (i use a geometry data provider for this purpose) to show vehicle moving and it's works fine,
but to refresh this layer i need to refresh whole the MapImage Control.
If it possible, how can i refresh only this layer without to refresh whole map?

Nov 21, 2006 at 6:41 PM
I would like to know how you created that Tracking Layer. Can you send an sample ???

Bittel Equipamentos Eletronicos
Nov 22, 2006 at 7:14 AM
This is the code i used:

VectorLayer m_VectorLayer = new VectorLayer("Vehicles");
List<Geometry> geomCol = new List<Geometry>();
geomCol.Add(new SharpMap.Geometries.Point(34.56189, 31.667323));
m_VectorLayer.DataSource = new GeometryProvider(geomCol);
m_VectorLayer.Style.Symbol = new Bitmap(Environment.CurrentDirectory + "\\Icons-bmp\\macro.bmp");
Map mMap.Layers.Add(mVectorLayer);

To update the place of Vehicles you should update the points in list of geometry.
I hope it helps you.
Nov 23, 2006 at 10:38 AM
i'm guessing you have some kind of trigger or time loop to regenerate the map.

Is it a static map?

If so, you could try to store the topo-image-map into memory or as a seperate file and draw the vehicles on top of that.

In that case Sharpmap only is needed for the topo-image-map and your own code is needed for the vehicles part. A possibility there is that you use 'Image Map' to let the user click on the vehicle and let it show some info in a popup or alike.
Nov 26, 2006 at 6:24 AM
Thanks, i will try it.