Java API for KML (JAK) embedding images in kmz files

后端 未结 2 809
难免孤独
难免孤独 2020-12-18 08:48

Is there a way to just add an image file into a kmz file using Java API for KML (JAK)? I can create a kml file with no problem, but I\'m trying to just embed a resources (su

2条回答
  •  遥遥无期
    2020-12-18 09:19

    I've been using JAK for over a year on a project. I use it to create the KML, then I marshal it as just plain KML (not KMZ). I created a separate utility class that uses the Java SE 'Zip' classes to manually create the KMZ. It works just fine. A KMZ is nothing more than a .zip archive that contains exactly one .kml file and 0 or more resource files (such as images, etc). The only difference is that you name the file as .kmz instead of .zip when you output it. In the KML document