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 ???
HI,
Here a link that may help you resolve your issue:
http://help.infragistics.com/NetAdvantage/WPF/Current/CLR4.0/?page=xamGeographicMap_Binding_Geographic_Data_Models.html
Sincerely,
Matt Developer Support Engineer
Thanks for the reply.
Unfortunately, that link only shows how to position the symbols using "hard-coded" locations.I am trying to position the symbols at the same locations that the map itself would use if it was displaying markers.
For example, if I use the following XAML (no code behind):
===============================================================
<UserControl x:Class="InfragisticsMapTester.Views.TestMarkerLocation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ig="http://schemas.infragistics.com/xaml" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <UserControl.Resources> <ig:ShapefileConverter x:Key="shapefileConverterWorld" ShapefileSource="ShapeFiles/world.shp" DatabaseSource="ShapeFiles/world.dbf" /> </UserControl.Resources> <Grid> <ig:XamGeographicMap BackgroundContent="{x:Null}"> <ig:XamGeographicMap.Series> <ig:GeographicShapeSeries ItemsSource="{StaticResource shapefileConverterWorld}" ShapeMemberPath="Points" MarkerType="Automatic" MarkerCollisionAvoidance="None" ToolTip="{Binding Item.Fields[CNTRY_NAME]}" /> </ig:XamGeographicMap.Series> </ig:XamGeographicMap> </Grid></UserControl>
The map will end up displaying the world shapefile, and it will automatically display markers over thecenter of each nation. (See attached file MapWithMarkers.jpg)
For my particular application, I don't want to use the automatic Markers. I want to use my own symbol series,but I want to position a symbol at the center of each nation on the map, located in the same place that the marker wouldhave been placed. I don't know how to programmtically compute the requires symbol locations.
Does that make sense?
Why do you need to use the SymbolSeries instead of using the markers of the ShapeSeries?
Calculating the X/Y Coordinates for the symbols based on a closed polygon can hurt performance.
Sincerely, Matt Developer Support Engineer
My map displays several ShapeSeries at the same time:
Layer 1 (bottom): world shapefile.Layer 2: usa states shapefile.Layer 3: usa counties shapefile.Layer 4 (top): my symbols.
My shapes have a solid color Fill.
If I enable markers for each ShapeSeries, markers at lower z-order are completely obscured by markers displayed at higher z-order layers (due to the solid color Fill).To overcome this problem, I created my own SymbolSeries at the top-zorder, so that my symbols would always be visible.
HI ,
Can you please address this question: