Hotel_Rooms.shp not showing in Editor

3 posts, 1 answers
  1. Moni
    Moni avatar
    39 posts
    Member since:
    Feb 2010

    Posted 01 Aug 2011 Link to this post

    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. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 04 Aug 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Moni
    Moni avatar
    39 posts
    Member since:
    Feb 2010

    Posted 04 Aug 2011 Link to this post

    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.
Back to Top