This is a migrated thread and some comments may be shown as answers.

map doesn't show up

1 Answer 61 Views
Map
This is a migrated thread and some comments may be shown as answers.
TMLP
Top achievements
Rank 1
TMLP asked on 12 Aug 2011, 09:34 PM
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..

1 Answer, 1 is accepted

Sort by
0
TMLP
Top achievements
Rank 1
answered on 13 Aug 2011, 12:52 AM
the shapefiles were not in the correct location. After setting that right, it works. Thanks.
Tags
Map
Asked by
TMLP
Top achievements
Rank 1
Answers by
TMLP
Top achievements
Rank 1
Share this question
or