Hello,
I have this code using Geo::GoogleEarth::Pluggable to create KML documents. I would like to add a "ScreenOverlay" to a KML generated with such module that would store a BMP legend for my point but I don't know how I can add it. This is the code generating the two KMLs:
Thanks for any suggestion on how to come up with a single KML with the ScreenOverlay included.use strict; use Geo::GoogleEarth::Pluggable; my $document=Geo::GoogleEarth::Pluggable->new( name=>'dummy', description=>'bbb', ); $document->LookAt( latitude => 50, longitude => 0, range => 30000, heading => 0, tilt => 0, ); my $folder; $folder = $document->Folder(name=>"FOLDER_1", description=>"FOLDER_1") +; my $icon_style = $folder->IconStyle( color => {red=>255, green=>0, blue=>0}, href => "http://maps.google.com/mapfiles/kml/shapes/square.png" +, scale => 0.4 ); my %point = ( name=>'POINT_1', lat=>50, lon=>0, alt=> 0, description=>'POINT_1', style => $icon_style, ); $folder->Point(%point); my $kstring = $document->archive; my $kfile = 'dummy.kml'; open(KK,">$kfile") or die "$kfile $!"; print KK $kstring; close (KK); my $kml_legend_file = 'dummy_legend.kml'; open (KML,">$kml_legend_file") or die $!; print KML qq(<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.googl +e.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:a +tom="http://www.w3.org/2005/Atom"> <ScreenOverlay id="idLegend"> <name>dummy_legend</name> <description></description> <Icon> <href>dummy_legend.bmp</href> </Icon> <overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/> <screenXY x="0" y="1" xunits="fraction" yunits="fraction"/> <rotationXY x="0.5" y="0.5" xunits="fraction" yunits="fraction"/> <size x="0" y="0" xunits="pixels" yunits="pixels"/> </ScreenOverlay> </kml>); close (KML);
In reply to How to modify KML files by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |