I tried the example from http://www.infragistics.com/community/blogs/mihail_mateev/archive/2011/11/07/introduction-to-infragistics-geographic-map.aspx
It shows the map control only without shapefile. I put the shapefile under "ClientBin\ShapeFiles\Cntry00" folder. I've updated the referenced DLL to the latest ones.
Is any thing wrong here? Thanks.
Here is the code:
<UserControl x:Class="XamGeographicMapDemo.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400" xmlns:ig="http://schemas.infragistics.com/xaml">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<RadialGradientBrush x:Key="mapBackground">
<GradientStop Color="#FFD4D4D4" Offset="1" />
<GradientStop Color="White" />
</RadialGradientBrush>
<ig:BrushCollection x:Key="shapeBrushes">
<SolidColorBrush Color="#FF38A3D6" />
<SolidColorBrush Color="#FF134157" />
</ig:BrushCollection>
<ig:RandomFillStyleSelector x:Key="shapeStyleSelector" Brushes="{StaticResource shapeBrushes}" />
<ig:ShapefileConverter x:Key="shapeFileSource"
ImportCompleted="OnShapefileImportCompleted"
ShapefileSource="/ClientBin/ShapeFiles/Cntry00/cntry00.shp"
DatabaseSource="/ClientBin/ShapeFiles/Cntry00/cntry00.dbf" />
</Grid.Resources>
<ig:XamGeographicMap HorizontalAlignment="Stretch" Margin="20" Name="xamGeographicMap1" Background="{StaticResource mapBackground}" VerticalAlignment="Stretch"
OverviewPlusDetailPaneVisibility="Visible" >
<ig:XamGeographicMap.BackgroundContent>
<ig:OpenStreetMapImagery Opacity="0" />
</ig:XamGeographicMap.BackgroundContent>
<ig:XamGeographicMap.Series>
<ig:GeographicShapeSeries ItemsSource="{StaticResource shapeFileSource}"
ShapeStyleSelector="{StaticResource shapeStyleSelector}"
ShapeMemberPath="Points" >
<ig:GeographicShapeSeries.MarkerTemplate>
<DataTemplate>
<TextBlock Text="{Binding Item.Fields[CNTRY_NAME]}" Foreground="White" />
</DataTemplate>
</ig:GeographicShapeSeries.MarkerTemplate>
</ig:GeographicShapeSeries>
</ig:XamGeographicMap.Series>
</ig:XamGeographicMap>
</Grid>
</UserControl>
Hello,
Thank you for your post. I have been looking into it and I tested the sample from Mihail’s blog with the latest Service release of 14.1 and everything seems to wok ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.
Thanks for the quick response!
It seems still doesn't work for me. I attached the screen shot. I tested in two ways:
1) download the zip you sent, ran it through visual studio 2013 without changing anything.
2) deploy your project (unzipped it first) to IIS server directly
It tested it in both Windows 7 and Windows 8.1 with Silverlight 5 installed, IE 10.
There is no error show up. When I debugged through, it reached to the constructor MainPage() in MainPage.xaml.cs, but not to OnShapefileImportCompleted event method.
Is anything missing on my side? Thanks.
Ning Sun
Hello Ning,
I can suggest you set the XamGeographicMapDemo.Web project as start up project, because the shape files are located in the CLientBin folder. Please let me know if this helps you or you have further questions on this matter.
I finally made it work by adding the following in web.config to let web server deal with the file extension related to shape files:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<staticContent>
<!--Remove the extensions (in case they were already defined in a parent) -->
<remove fileExtension=".shp" />
<remove fileExtension=".shx" />
<remove fileExtension=".dbf" />
<remove fileExtension=".ogg" />
<!--Add the file extensions -->
<mimeMap fileExtension=".shp" mimeType="application/octet-stream" />
<mimeMap fileExtension=".shx" mimeType="application/octet-stream" />
<mimeMap fileExtension=".dbf" mimeType="application/octet-stream" />
<mimeMap fileExtension=".ogg" mimeType="audio/ogg" />
</staticContent>
</system.webServer>
Thanks for the help.
Hello Nico,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.