map doesn't show up

2 posts, 0 answers
  1. TMLP
    TMLP avatar
    38 posts
    Member since:
    Jul 2009

    Posted 12 Aug 2011 Link to this post

    I'm trying to follow this sample (http://demos.telerik.com/silverlight/#Map/Shapefile/World)
    when I run my code, the map doesn't show up, just a blue rect. shows up. what am I missing?

    <UserControl x:Class="WorldMapControlRadSL.MainPage"
            xmlns:example="clr-namespace:WorldMapControlRadSL"
            mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
         
        <UserControl.Resources>
            <example:ShapefileViewModel x:Key="DataContext" Region="world"/>
        </UserControl.Resources>
        <Grid x:Name="LayoutRoot" Width="640" Height="480">
            <telerik:RadMap x:Name="RadMap1"
                            Background="#d9e1ff"
                            BorderThickness="1"
                            UseDefaultLayout="False"
                            MouseClickMode="None"
                            MouseDoubleClickMode="None"
                            ZoomLevel="3"
                            Center="61.9389504266604, 24.697265625"
                            MinZoomLevel="3"
                            MaxZoomLevel="4">
                <telerik:RadMap.Provider>
                    <telerik:EmptyProvider />
                </telerik:RadMap.Provider>
                <telerik:InformationLayer x:Name="InformationLayer">
                    <telerik:InformationLayer.Reader>
                        <telerik:MapShapeReader Source="{Binding Source={StaticResource DataContext}, Path=ShapefileSourceUri}"
                                                DataSource="{Binding Source={StaticResource DataContext}, Path=ShapefileDataSourceUri}"
                                                ToolTipFormat="CNTRY_NAME" />                   
                    </telerik:InformationLayer.Reader>
                    <telerik:InformationLayer.ShapeFill>
                        <telerik:MapShapeFill Fill="#fff7de" Stroke="#5a6368" StrokeThickness="1" />
                    </telerik:InformationLayer.ShapeFill>
                    <telerik:InformationLayer.HighlightFill>
                        <telerik:MapShapeFill Fill="#f7e7bd" Stroke="#5a6368" StrokeThickness="1" />
                    </telerik:InformationLayer.HighlightFill>
                </telerik:InformationLayer>
            </telerik:RadMap>
        </Grid>
    </UserControl>


    And, my ShapefileViewModel.cs is exactly same as the sample code provided..
  2. TMLP
    TMLP avatar
    38 posts
    Member since:
    Jul 2009

    Posted 12 Aug 2011 Link to this post

    the shapefiles were not in the correct location. After setting that right, it works. Thanks.
  3. DevCraft banner
Back to Top