Hello everyone,
Quite new to all of this, so I'm hoping someone can nudge me in the right direction. I'm trying to load a KML file, but I can't seem to get my head around the URI part. Can someone provide me with an idiot-proof example? For instance, if I have a project called "Map_Test" and within that project I have a folder called "Recources" and within that folder I have a file called "doc.kml", what would be the uri?
This is what I tried and I get the message that "Cannot locate resource 'Map_Test;resources/doc.kml'.
Any help is greatly appreciated. Here is my code:
Quite new to all of this, so I'm hoping someone can nudge me in the right direction. I'm trying to load a KML file, but I can't seem to get my head around the URI part. Can someone provide me with an idiot-proof example? For instance, if I have a project called "Map_Test" and within that project I have a folder called "Recources" and within that folder I have a file called "doc.kml", what would be the uri?
This is what I tried and I get the message that "Cannot locate resource 'Map_Test;resources/doc.kml'.
Any help is greatly appreciated. Here is my code:
Private
Sub
LoadKMLData()
Dim
streamResource
As
StreamResourceInfo = Application.GetResourceStream(
New
Uri(
"pack://application:,,,/Map_Test;Resources/doc.kml"
, UriKind.RelativeOrAbsolute))
Dim
elements
As
List(Of FrameworkElement) = KmlReader.Read(streamResource.Stream)
For
Each
element
As
FrameworkElement
In
elements
Me
.informationLayer.Items.Add(element)
Next
element
End
Sub
Also tried this with no luck either. Gives me a "Cannot locate resouce 'doc.kml':
DimstreamResource
As
StreamResourceInfo = Application.GetResourceStream(
New
Uri(
"/Map_Test;component/Resources/doc.kml"
, UriKind.RelativeOrAbsolute))
' Dim streamResource As StreamResourceInfo = Application.GetResourceStream(New Uri("doc.kml", UriKind.RelativeOrAbsolute))
Dim
elements
As
List(Of FrameworkElement) = KmlReader.Read(streamResource.Stream)
For
Each
element
As
FrameworkElement
In
elements
Me
.informationLayer.Items.Add(element)
Next
element