Projects/KML Export/Manual/Parser functions

From juliano.info

Jump to: navigation, search

This page describes the syntax of parser functions defined by KML Export.

Contents

KML markup functions

These functions are used to define KML features and their properties in article pages.

kml.placemark

Sets a placemark for the current article. This function instantiates a <Placemark> KML feature.

{{#kml.placemark: geometry 
|id=id
|name=name
|visibility=visibility
|open=open
|snippet=snippet
|style=style
|description
}} 

Arguments

Argument Type Description
geometry string Geometry of the placemarks (usually a point with latitude and longitude coordinates). See #Geometry syntax below.
id (optional) string Used to refer to this feature.
name (optional) string Name of the feature. If not provided, the page title is used.
visibility (optional) boolean Sets visibility of the feature.
open (optional) boolean Sets if feature tree node is open.
snippet (optional) string Sets snippet text of the feature.
style (optional) string Sets style URL of the feature.
description (optional) string Sets the description of the placemark.

Geometry syntax

Currently, the only geometry type supported is Point, that instantiates a <Point> KML geometry.

Point(latitude, longitude, altitude)
Argument Type Description
latitude numeric Latitude of the feature.
longitude numeric Longitude of the feature.
altitude (optional) numeric Altitude of the feature. If omitted, the feature is set to the ground level.

Returns

On success, this parser function returns no text. If the syntax is not understood, a red error message box is displayed.

kml.folder

Puts features of the current article into a subfolder of the KML tree and also sets parameters of this folder. Categories always generate folders even if kml.folder is not used. Articles may generate folders depending on extension Configuration and if there are more than one feature on the same article. This function instantiates a <Folder> KML feature.

{{#kml.folder: 
 id=id
|name=name
|visibility=visibility
|open=open
|snippet=snippet
|style=style
|description
}}

Arguments

Argument Type Description
id (optional) string Used to refer to this folder.
name (optional) string Name of the folder. If not provided, the page title is used.
visibility (optional) boolean Sets visibility of the folder.
open (optional) boolean Sets if folder tree node is open.
snippet (optional) string Sets snippet text of the folder.
style (optional) string Sets style URL of the folder.
description (optional) string Sets the description of the folder.

Returns

On success, this parser function returns no text. If the syntax is not understood, a red error message box is displayed.

kml.style

Creates a named style that can be referenced by the style= property of #kml.placemark and #kml.folder. This function instantiates a <Placemark> KML feature.

{{#kml.style: id 
|style
|...
}} 

Arguments

Argument Type Description
id string Style identifier.
style (optional) style One or more style definitions. See below.

Style syntax

IconStyle(#color random href=address scale=scale heading=heading)
LabelStyle(#color random scale=scale)
LineStyle(#color random width=scale)
PolyStyle(#color random nofill nooutline)
BalloonStyle(bgcolor=#bgcolor textcolor=#textcolor text)

Returns

On success, this parser function returns no text. If the syntax is not understood, a red error message box is displayed.

kml.text

Instantiates a text block where you can insert arbitrary wiki markup. This parser function is currently strictly used by BalloonStyle.

{{#kml.text:
wiki markup
}}

Convenience functions

lat_deg2dms, long_deg2dms

Convert geographic coordinates in degree notation to degrees-minutes-seconds notation.

Syntax

{{#lat_deg2dms: value }}
{{#long_deg2dms: value }}

Arguments

Argument Type Description
value numeric Latitude (for lat_deg2dms) or longitude (for long_deg2dms) decimal degree value.

Returns

lat_deg2dms returns a formated string value between 90° 00′ 00.0″ S and 90° 00′ 00.0″ N. long_deg2dms returns a formated string value between 180° 00′ 00.0″ W and 180° 00′ 00.0″ E.

lat_dms2deg, long_dms2deg

Convert geographic coordinates in degrees-minutes-seconds notation to degree notation.

Syntax

{{#lat_dms2deg: degrees | minutes | seconds | hemisphere }}
{{#long_dms2deg: degrees | minutes | seconds | hemisphere }}

Arguments

Argument Type Description
degrees numeric Degrees part of the latitude or longitude coordinate.
minutes numeric Minutes part of the latitude or longitude coordinate.
seconds numeric Seconds part of the latitude or longitude coordinate.
hemisphere character A single letter, either N or S for lat_dms2deg, W or E for long_dms2deg.

Returns

Both functions return the converted decimal degree value.

Views