.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Geo::GoogleEarth::Pluggable 3pm" .TH Geo::GoogleEarth::Pluggable 3pm "2021-11-28" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Geo::GoogleEarth::Pluggable \- Generates GoogleEarth Documents .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 8 \& use Geo::GoogleEarth::Pluggable; \& my $document=Geo::GoogleEarth::Pluggable\->new(%data); #is a special Folder... \& my $folder =$document\->Folder(%data); #isa Geo::GoogleEarth::Pluggable::Folder \& my $point =$document\->Point(%data); #isa Geo::GoogleEarth::Pluggable::Point \& my $netlink =$document\->NetworkLink(%data); #isa Geo::GoogleEarth::Pluggable::NetworkLink \& my $lookat =$document\->LookAt(%data); #isa Geo::GoogleEarth::Pluggable::LookAt \& my $style =$document\->Style(%data); #isa Geo::GoogleEarth::Pluggable::Style \& print $document\->render; .Ve .PP \&\s-1KML CGI\s0 Example .PP .Vb 4 \& use Geo::GoogleEarth::Pluggable; \& my $document=Geo::GoogleEarth::Pluggable\->new(name=>"KML Document"); \& print $document\->header, \& $document\->render; .Ve .PP \&\s-1KMZ CGI\s0 Example .PP .Vb 4 \& use Geo::GoogleEarth::Pluggable; \& my $document=Geo::GoogleEarth::Pluggable\->new(name=>"KMZ Document"); \& print $document\->header_kmz, \& $document\->archive; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Geo::GoogleEarth::Pluggable is a Perl object oriented interface that allows for the creation of \s-1XML\s0 documents that can be used with Google Earth. .PP Geo::GoogleEarth::Pluggable (aka Document) is a Geo::GoogleEarth::Pluggable::Folder with a render method. .SS "Object Inheritance Graph" .IX Subsection "Object Inheritance Graph" .Vb 12 \& \-\-\- Constructor \-+\- Base \-\-\- Folder \-\-\- Document \& | | \& | +\- Placemark \-+\- Point \& | | +\- LineString \& | | +\- LinearRing \& | | \& | +\- StyleBase \-+\- Style \& | | +\- StyleMap \& | | \& | +\- NetworkLink \& | \& +\- LookAt .Ve .SS "Constructors that append to the parent folder object" .IX Subsection "Constructors that append to the parent folder object" Folder, NetworkLink, Point, LineString, LinearRing .SS "Constructors that return objects for future use" .IX Subsection "Constructors that return objects for future use" \&\fBLookAt()\fR, \fBStyle()\fR, \fBStyleMap()\fR .SS "Wrappers (what makes it easy)" .IX Subsection "Wrappers (what makes it easy)" Style => IconStyle, LineStyle, PolyStyle, LabelStyle, ListStyle .PP Point => MultiPoint .SH "USAGE" .IX Header "USAGE" This is all of the code you need to generate a complete Google Earth document. .PP .Vb 4 \& use Geo::GoogleEarth::Pluggable; \& my $document=Geo::GoogleEarth::Pluggable\->new; \& $document\->Point(name=>"White House", lat=>38.897337, lon=>\-77.036503); \& print $document\->render; .Ve .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .SS "new" .IX Subsection "new" .Vb 1 \& my $document=Geo::GoogleEarth::Pluggable\->new(name=>"My Name"); .Ve .SH "METHODS" .IX Header "METHODS" .SS "type" .IX Subsection "type" Returns the object type. .PP .Vb 1 \& my $type=$folder\->type; .Ve .SS "document" .IX Subsection "document" Returns the document object. .PP All objects know to which document they belong even the document itself! .SS "render" .IX Subsection "render" Returns an \s-1XML\s0 document with an \s-1XML\s0 declaration and a root name of \*(L"Document\*(R" .PP .Vb 1 \& print $document\->render; .Ve .SS "archive" .IX Subsection "archive" Returns a \s-1KMZ\s0 formatted Zipped archive of the \s-1XML\s0 document .PP .Vb 1 \& print $document\->archive; .Ve .SS "xmlns" .IX Subsection "xmlns" Add or update a namespace .PP .Vb 1 \& $document\->xmlns\->{"namespace"}=$url; .Ve .PP Delete a namespace .PP .Vb 1 \& delete($document\->xmlns\->{"xmlns:gx"}); .Ve .PP Replace all namespaces .PP .Vb 1 \& $document\->{"xmlns"}={namespace=>$url}; .Ve .PP Reset to default namespaces .PP .Vb 1 \& delete($document\->{"xmlns"}); .Ve .SS "nextId" .IX Subsection "nextId" This method is in the document since all Styles and StyleMaps are in the document not folders. .PP .Vb 1 \& my $id=$document\->nextId($type); #$type in "Style" or "StyleMap" .Ve .SS "header, header_kml" .IX Subsection "header, header_kml" Returns a header appropriate for a web application .PP .Vb 2 \& Content\-type: application/vnd.google\-earth.kml+xml \& Content\-Disposition: attachment; filename=filename.xls \& \& $document\->header #embedded in browser \& $document\->header(filename=>"filename.xls") #download prompt \& $document\->header(content_type=>"application/vnd.google\-earth.kml+xml") #default content type .Ve .SS "header_kmz" .IX Subsection "header_kmz" Returns a header appropriate for a web application .PP .Vb 2 \& Content\-type: application/vnd.google\-earth.kml+xml \& Content\-Disposition: attachment; filename=filename.xls \& \& $document\->header_kmz #embedded in browser \& $document\->header_kmz(filename=>"filename.xls") #download prompt \& $document\->header_kmz(content_type=>"application/vnd.google\-earth.kmz") #default content type .Ve .SH "TODO" .IX Header "TODO" .IP "Support for default Polygon and Line styles that are nicer than GoogleEarth's" 4 .IX Item "Support for default Polygon and Line styles that are nicer than GoogleEarth's" .PD 0 .IP "Support for DateTime object in the constructor that is promoted to the LookAt object." 4 .IX Item "Support for DateTime object in the constructor that is promoted to the LookAt object." .IP "Create a GPS::Point plugin (Promote tag as name and datetime to LookAt)" 4 .IX Item "Create a GPS::Point plugin (Promote tag as name and datetime to LookAt)" .PD .SH "BUGS" .IX Header "BUGS" Please log on \s-1RT\s0 and send to the geo-perl email list. .SH "LIMITATIONS" .IX Header "LIMITATIONS" .SS "Not So Pretty \s-1XML\s0" .IX Subsection "Not So Pretty XML" The \s-1XML\s0 produced by XML::LibXML is not \*(L"pretty\*(R". If you need pretty \s-1XML\s0 you must pass the output through xmllint or a simular product. .PP For example: .PP .Vb 1 \& perl \-MGeo::GoogleEarth::Pluggable \-e "print Geo::GoogleEarth::Pluggable\->new\->render" | xmllint \-\-format \- .Ve .SS "Write Only" .IX Subsection "Write Only" This package can only write \s-1KML\s0 and \s-1KMZ\s0 files. However, if you need to read \s-1KML\s0 files, please see the Geo::KML package's \f(CW\*(C`from\*(C'\fR method. .SH "SUPPORT" .IX Header "SUPPORT" DavisNetworks.com supports all Perl applications including this package. .SH "AUTHOR" .IX Header "AUTHOR" .Vb 2 \& Michael R. Davis (mrdvt92) \& CPAN ID: MRDVT .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" This program is free software licensed under the... .PP .Vb 1 \& The BSD License .Ve .PP The full text of the license can be found in the \s-1LICENSE\s0 file included with this module. .SH "SEE ALSO" .IX Header "SEE ALSO" Geo::KML, XML::LibXML, XML::LibXML::LazyBuilder, Archive::Zip, IO::Scalar