Extension:KML Export/Special:KMLExport

From MediaWiki.org
Jump to navigation Jump to search
KML Export Features Installation Quick start How to use Parser functions Special pages Configuration Style syntax

The Special:KMLExport special page scans for KML features set in article pages and generates a KML document with the placemarks and other content set through KML Export's parser functions. This special page is the whole purpose of the KML Export extension.

Only articles in a given category (and it's subcategories) are scanned for KML features. Subcategories are represented by folders in the generated output.

Syntax[edit]

Special:KMLExport

By calling this special page with no parameters, the category given in the kmlexport-root-category system message (defaults to "Category:Articles with geographic coordinates") is processed and its articles are scanned for KML features. The user may request a different category by providing the category name after the page name, joined by a slash character:

Special:KMLExport/category_title

There is no need to provide the namespace, the "Category:" namespace is chosen by default. The category must either be a descendant of the root category (see above), or contain a {{#kml.folder}} function call.

The output is returned with a content-type of application/vnd.google-earth.kml+xml, which is suitable for Google Earth. The user may request the output to be returned with a different content-type by providing it through ctype parameter:

Special:KMLExport?ctype=content-type

Possible content-types recognized are: application/vnd.google-earth.kml+xml, application/xml and text/xml.

By accessing this page, the user's user agent should ask him/her to either save the file or open it with Google Earth (if installed). The user may also add a new network link from Google Earth pointing to the full URL of the special page, or accessing it from Google Maps.

Articles scanned[edit]

Firstly, kmlexport-common is scanned and any KML markup in it is parsed and added to the output. This is useful for setting common styles, that should always be present on the generated KML output.

Then, the appropriate category is scanned for KML markup. You may set styles common to articles in that category in the category article text. Then, all articles and categories in that category are recursively scanned in a depth-first manner.