KML iconstyle

2 posts, 0 answers
  1. jtby
    jtby avatar
    43 posts
    Member since:
    Feb 2007

    Posted 01 Dec 2013 Link to this post

    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?



  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 03 Dec 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top