How can I add a Icon to a Folder?

148 views
Skip to first unread message

Lucas Albuquerque

unread,
Jun 27, 2013, 6:08:32 AM6/27/13
to javaap...@googlegroups.com
Hello, I need to add a Icon to a folder, something like this:

<Folder> Hello 
<Icon><hreft>"hello.png"</hreft></Icon>
</Folder>

Is there some way to do it using JAK? something like  folder.add Icon(Icon).

Thomas Buissart

unread,
Jun 27, 2013, 8:44:15 AM6/27/13
to javaap...@googlegroups.com
Hello,

In KML, a folder is a container for placemarks (marker, polygons...). You can't add an icon to a placemarks container, that's why it isn't possible with JAK I guess. You can see the reference for all KML elements here : https://developers.google.com/kml/documentation/kmlreference#folder .

But you can add an icon to a point for example :
With JAK :

        Kml kml = new Kml();
        Folder folder = kml.createAndSetFolder();
        Style myStyle = folder.createAndAddStyle().withId(myStyleID);
        myStyle
                .withIconStyle(
                        new IconStyle()
                                .withIcon(
                                        new Icon()
                                                .withHref(iconURL))
                                .withScale(1));
        folder.createAndAddPlacemark().withStyleUrl(#myStyleID).createAndSetPoint().withCoordinates(someCoordinates);

Something like that should work. :)
Reply all
Reply to author
Forward
0 new messages