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

Hotel_Rooms.shp not showing in Editor

2 Answers 45 Views
Map
This is a migrated thread and some comments may be shown as answers.
Moni
Top achievements
Rank 1
Moni asked on 01 Aug 2011, 05:19 PM

Getting familiar with the Hotel Map example:
System: VS2010 Prof.; RadControls for Silverlight, v.2011.2.712.1040; SL 4.0
Created a new SL project.
Copy pasted the Hotel XML + CS into the new project.
Adjusted the namespace + class names + path locations.
Copy pasted + added to project all relevant Shape and JPG files.
Adjustted path locations in both CS. and .XAML
Copy pasted the Web.Config.
Compared both Prj. properties - seem identical.
JPG shows fine.

Problem:
The hotel rooms map do not show in the editor. This causes a null exception in

MapShapeReader_PreviewReadCompleted in the uriArray[...] object.

added to MapShapeReader
DataSource="/RadControlsSilverlightApp3;component/ShapeFiles/Hotel_Rooms.dbf"
(example works without it)

Out of ideas what am I missing.
I attach the entire project.

Many thanks.

P.S. I can provide the entire project but this is the "business" portion.


<telerik:RadMap x:Name="radMap"
      Center="0.00566482542974434,-0.00197817993118133"
      ZoomLevel="13"
      MouseClickMode="None"
      UseDefaultLayout="False"
      UseSpringAnimations="False"
                        Background="Transparent"
                        IsMouseWheelZoomEnabled="False"
                        MouseDragMode="None"
                        MouseDoubleClickMode="None"
                        Grid.Row="1"
                        Grid.Column="0"
                        Width="784"
                        Height="484">
            <telerik:RadMap.Provider>
                <telerik:EmptyProvider/>
            </telerik:RadMap.Provider>
            <telerik:InformationLayer x:Name="informationLayer">
                <telerik:InformationLayer.ShapeFill>
                    <telerik:MapShapeFill Fill="#feee" Stroke="White" StrokeThickness="1" />
                </telerik:InformationLayer.ShapeFill>
                <telerik:InformationLayer.Reader>
                    <telerik:MapShapeReader ClearLayer="False"
                                            PreviewReadCompleted="MapShapeReader_PreviewReadCompleted"
                                            ReadCompleted="MapShapeReader_ReadCompleted"
                                            DataSource="/RadControlsSilverlightApp3;component/ShapeFiles/Hotel_Rooms.dbf"
                                            Source="/RadControlsSilverlightApp3;component/ShapeFiles/Hotel_Rooms.shp">
                    </telerik:MapShapeReader>
                </telerik:InformationLayer.Reader>
            </telerik:InformationLayer>
        </telerik:RadMap>

2 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 04 Aug 2011, 09:11 AM
Hi Moni,

I have tried to build a separate solution from the Hotel example. It works nice. Most often the problem with reading shape files from resources occurs when the "Build Action" for shape files is not specified to "Resource".

Kind regards,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Moni
Top achievements
Rank 1
answered on 04 Aug 2011, 03:16 PM
Thank you Andrey!
Yes, after adding a source file then going to Properties and switching the build action from "None" to "Resource" made it appear.
Tags
Map
Asked by
Moni
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Moni
Top achievements
Rank 1
Share this question
or