This is a migrated thread and some comments may be shown as answers.
RadMap and KMLReader -can't get URI as streaminfo
2 Answers 45 Views
Map
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 12 Jul 2010, 10:48 AM

I can’t get the URI to return for the RADMAP. My project is called Maptest and I have tried placing the kml file in the root of the project, the root of the web project the client bin, pretty much everywhere.

I have tried referring to it with

eu.kml

..\eu.kml

..\MapTest\eu.kml

\eu.kml

\maptest.kml

And any other combinations I could think of. The map is viewable through localhost and the internet and I am using OpenStreetMap

Here is my code, which returns an Object not set/NullReference exception when trying to read the stream.

 Dim streamInfo As StreamResourceInfo = Application.GetResourceStream(New Uri("eu.kml", UriKind.RelativeOrAbsolute))

 

 

        ' loading the boundaries of the European Union

        Dim list As List(Of FrameworkElement) = KmlReader.Read(streamInfo.Stream)

 


 

  Any help would be greatly appreciated

Tom


2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 12 Jul 2010, 06:25 PM
Hello Tom,

First of all you must be sure that your KML file is included to your project as Resource:
  1. Select KML file in the solution explorer.
  2. Go to the “Properties” window.
  3. Check that “Build Action” set to “Resource”.
Next, you need to update the URI schemas for resource file. You’ve tried file system like URIs, but Silverlight doesn’t allow it. Right URI schema for resource file must include application name and resource location. For the ‘Maptest’ application and resource file located at the root of the project it will be:

"/Maptest;component/eu.kml"

StreamResourceInfo streamInfo = Application.GetResourceStream(
    new Uri("/Maptest;component/eu.kml", UriKind.RelativeOrAbsolute));

Greetings,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tom
Top achievements
Rank 1
answered on 13 Jul 2010, 08:27 AM
Thank you,

I continue to be impressed

Tom
Tags
Map
Asked by
Tom
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Tom
Top achievements
Rank 1
Share this question
or