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:
PrivateSubLoadKMLData()DimstreamResourceAsStreamResourceInfo = Application.GetResourceStream(NewUri("pack://application:,,,/Map_Test;Resources/doc.kml", UriKind.RelativeOrAbsolute))DimelementsAsList(Of FrameworkElement) = KmlReader.Read(streamResource.Stream)ForEachelementAsFrameworkElementInelementsMe.informationLayer.Items.Add(element)NextelementEndSub
Also tried this with no luck either. Gives me a "Cannot locate resouce 'doc.kml':
DimstreamResourceAsStreamResourceInfo = Application.GetResourceStream(NewUri("/Map_Test;component/Resources/doc.kml", UriKind.RelativeOrAbsolute))' Dim streamResource As StreamResourceInfo = Application.GetResourceStream(New Uri("doc.kml", UriKind.RelativeOrAbsolute))DimelementsAsList(Of FrameworkElement) = KmlReader.Read(streamResource.Stream)ForEachelementAsFrameworkElementInelementsMe.informationLayer.Items.Add(element)Nextelement