This is a migrated thread and some comments may be shown as answers.

KML iconstyle

1 Answer 14 Views
Map
This is a migrated thread and some comments may be shown as answers.
jtby
Top achievements
Rank 1
jtby asked on 02 Dec 2013, 04:48 AM

From the examples I can load a KML file to an informationlayer like this:


Dim streamResource As StreamResourceInfo = Application.GetResourceStream(New Uri("/MyApp;component/Resources/bulgaria.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


... however in your Bulgaria.kml example I notice this:



<Icon>

<href>http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png</href>

</Icon>


... how can I change it so that placemark_circle.png is local, and does not require google?  When I copy the .png file to a local location, no value for the icon href works for adding to the information layer.  Do you have any suggestions?



1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 03 Dec 2013, 01:34 PM
Hi John,

You can add an icon to the project as a resource. And then you can use it in kml-file like the following:

<Icon>
    <href>pack://application:,,,/MyApp;component/Resources/placemark_circle.png</href>
</Icon>

Please give this approach a try and let us know if it helps.

Regards,

Andrey Murzov

Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

Sign up for Free application insights >>
Tags
Map
Asked by
jtby
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or