exportGge plugin is coupled to modified "tables" and "query" coreplugins
based on cartoweb version mentionned in "install.txt". This might change in the
future if possible. exportGge supports different EPSG projections
(for the mapfile, not for the individual layers). For now exportGge won't
perform well on layers with a great amount of features (=shapes).
To use exportGge in your own project you need to:
wherever you want the google earth icon to appear in your templates.
php cw3setup.php --clean --project YOUR_PROJECT
exportGge uses smarty templates to customize the rendering of layers in geoRSS and KML. Since 0.92 each layer can have it's own template but it is also possible to specify the template dynamically by setting the value of the "ggetpl" parameter in the URL.
Templates for geoRSS rendering are found under exportGge/templates/dataformat/georss .
Templates for KML rendering are found under exportGge/templates/dataformat/kml .
By default exportGge will use georss.tpl, georss_point.tpl, georss_line.tpl and georss_polygon.tpl for geoRSS rendering and kml.tpl, kml_point.tpl, kml_line.tpl and kml_polygon.tpl for KML rendering.
The following example illustrates the flexibility for rendering different layers in KML in different ways ( same things count for geoRSS). Let's suppose we want to render the lake layer ( CartoWeb layer name ) which is a polygon layer differently then the other polygon layers. To do this we just need to create a file called kml_lake_polygon.tpl. Once created this template will be used instead of kml_polygon.tpl. It might also be that on certain pages we want all polygons layers to be rendered differently. By passing for example ggetpl=mytemplate in the url, exportGge will try to use templates with _mytemplate in the template name. For the lake layer with ggetpl=mytemplate in the URL, exportGge will first look for : kml_mytemplate_lake_polygon.tpl. If the file can't be found it will try to use kml_mytemplate_polygon.tpl . If still not available it will try kml_lake_polygon.tpl and finally drop to kml_polygon.tpl, the default template. The naming convention is the same for line and point templates and also for the main template kml.tpl.
Having a look under exportGge/templates/dataformat/ might help to understand the trick.
geoJSON rendering is not using templates and is generated directly in the exportGge plugin client Class.
<Networklink> may be changed in exportGge/templates/dataformat/kml/wms.tpl
<GroundOverlay> may be changed in exportGge/templates/dataformat/kml/groundoverlay.tpl
wms.tpl and groundoverlay.tpl are globally used and can't be specific to a layer by renaming them. KML styles may be defined in exportGge/templates/dataformat/kml/kml.tpl
The way data is accessed in the templates tries to be close to the
Mapscript API syntax (ex : $line->numpoints, $shape->line($i) .. )
but the objects are no mapscript objects.
Differences between default demoCW3 and demoCW3gge: