On Mon Mar 23 19:32:48 2015, jidanni@jidanni.org wrote:
Show quoted text> There is no way to turn off printing at least a
> <Snippet maxLines="0"/>
> when rendering.
>
> Package: libgeo-googleearth-pluggable-perl
> Version: 0.15-2
I feel this is consistent with the documentation. Please provide patch of how you think the requirement should be implemented.
$ perl -e '
use Geo::GoogleEarth::Pluggable;
my $document = Geo::GoogleEarth::Pluggable->new(Snippet=>"line 1");
print $document->render;
'
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="
http://www.opengis.net/kml/2.2" xmlns:kml="
http://www.opengis.net/kml/2.2" xmlns:gx="
http://www.google.com/kml/ext/2.2" xmlns:atom="
http://www.w3.org/2005/Atom"><Document><Snippet maxLines="1">line 1</Snippet></Document></kml>
Code in question
lib/Geo/GoogleEarth/Pluggable/Folder.pm
push @data, E(Snippet=>{maxLines=>scalar(@{$self->Snippet})}, join("\n", @{$self->Snippet}));
/lib/Geo/GoogleEarth/Pluggable/Base.pm
Returns the Snippet used in the Snippet XML element or a Placemark. The default Snippet from Google Earth is to use the first line of the description however this package defaults to a zero line Snippet.
Snippet is rendered with maxLines as the length of the array ref and the content joined with new lines.
Typical use
$document->Point(Snippet=>"Line 1");
$document->Point(Snippet=>["Line 1", "Line 2"]);
Extended used
my $snippet=$placemark->Snippet; #[] always array reference
$placemark->Snippet([]); #default
$placemark->Snippet(["line 1", "line 2", "line 3"]);
$placemark->Snippet("My Snippet Text"); #folded into array reference.
$placemark->Snippet("line 1", "line 2", "line 3"); #folded into array reference
Thanks,
Mike