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:

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);
Thanks for any suggestion on how to come up with a single KML with the ScreenOverlay included.

In reply to How to modify KML files by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.