Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Set location of symbols on map programmatically
posted

I have a XamGeographicMap with one GeographicShapeSeries showing the world map (using the ShapeFiles/world from the wpf sample application). If I set the map to show Markers for all the shapes (nations in the world), then the displayed markers are automatically positioned in the correct location of the map. If, however, I try to programmatically show symbols using a GeographicSymbolSeries, the displayed symbols are in the wrong location on the map.

I am using the following to determine the location of the symbols:

var series = new GeographicSymbolSeries();
series.LongitudeMemberPath = "Longitude";
series.LatitudeMemberPath = "Latitude";
series.MarkerCollisionAvoidance = Infragistics.Controls.Charts.CollisionAvoidanceType.None;

...

// For each shape in my shape file, add a symbol to the symbol series using the first geographic point of the shape.
// THIS IS INCORRECT: the symbol ends up in a different location than the corresponding marker. QUESTION: how does the map compute the location of the marker??

var x = item.Points[ 0 ][ 0 ].X; // WRONG ???
var y = item.Points[ 0 ][ 0 ].Y; // WRONG ???