RadMap and KMLReader -can't get URI as streaminfo

3 posts, 0 answers
  1. Tom
    Tom avatar
    5 posts
    Member since:
    Aug 2008

    Posted 12 Jul 2010 Link to this post

    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






    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


  2. Andrey
    Andrey avatar
    1681 posts

    Posted 12 Jul 2010 Link to this post

    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:


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

    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
  3. Tom
    Tom avatar
    5 posts
    Member since:
    Aug 2008

    Posted 13 Jul 2010 Link to this post

    Thank you,

    I continue to be impressed

Back to Top