Template:Trail Map: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m add pressees around legacy part |
||
| (30 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<noinclude>This returns a map of the | <noinclude>This returns a map of the page's trail (or as set). This version uses/requires Leaflet for the maps and GeoJson for the trail routes. | ||
It should be called in the following format: | It should be called in the following format: | ||
<pre> | <pre> | ||
{{Trail Map|Main Trail={{PAGENAME}}|Other Trails= }} | {{Trail Map Leaflet|Main Trail={{PAGENAME}}|Other Trails=|Zoom=[any whole number to override zoom]}} | ||
</pre> | </pre> | ||
Parameter Main Trail is optional and will default to the pagename. Optionally, additional trails can be requested to have the | Parameter Main Trail is optional and will default to the pagename. Optionally, additional trails can be requested to have the GeoJson be shown by listing Trail page names separated by semicolons. | ||
Future features could allow specifying map settings. | Future features could allow specifying map settings. | ||
| Line 15: | Line 15: | ||
-->{{#arraydefine:othertrailnames|{{{Other Trails|}}}}}<!-- | -->{{#arraydefine:othertrailnames|{{{Other Trails|}}}}}<!-- | ||
-->{{#arraymerge:alltrailnames|maintrail|othertrailnames}}<!-- | -->{{#arraymerge:alltrailnames|maintrail|othertrailnames}}<!-- | ||
-->{{#ask: [[{{#arrayprint:alltrailnames |{{!}}{{!}}| | -->{{#ask: [[{{#arrayprint:alltrailnames|{{!}}{{!}}}}||Report:{{PAGENAME}}]] | ||
| ?Has | | ?Has GeoJson Page | ||
| format = array | | format = array | ||
| name = | | name = GJpages | ||
| link=none | |||
| mainlabel=- | |||
| headers=hide | |||
}}<!-- | }}<!-- | ||
-->{{#compound_query:[[{{#arrayprint:alltrailnames|{{!}}{{!}}}}]] | -->{{#compound_query:[[{{#arrayprint:alltrailnames|{{!}}{{!}}}}]] | ||
| Line 172: | Line 174: | ||
;?Has Marker Title | ;?Has Marker Title | ||
;?Has Marker Description | ;?Has Marker Description | ||
|format= | |[[Category:Map Markers]] [[-Has subobject::{{#arrayprint:alltrailnames|{{!}}{{!}}}}]] [[Is Marker Type::Station]] | ||
| | ; icon = Rangerstation.png | ||
| | ;?Has Marker Location | ||
| | ;?Has Marker Title | ||
;?Has Marker Description | |||
|format=leaflet | |||
|zoom={{{Zoom|}}} | |||
|fullscreen=on | |||
|layers=OpenTopoMap, OpenStreetMap | |||
|width=auto | |width=auto | ||
|height=600 | |height=600 | ||
|template=Map Balloon Template | |template=Map Balloon Template | ||
| | |geojson={{#arraymap:{{#arrayprint:GJpages}}|,|@@@@|{{#replace:@@@@|<nowiki> </nowiki>|_}}|;}} | ||
}} | }} | ||
[[GeoJson:{{#titleparts:{{#arrayprint:maintrail}}}}|GeoJson Page]]{{#ifexist:GeoJson:{{#titleparts:{{#arrayprint:maintrail}}}}| / [{{Create Profile Link|KML={{fullurl:GeoJson:{{#titleparts:{{#arrayprint:maintrail}}}}}}?action=raw|Title={{#arrayprint:maintrail}}}} Create Profile Chart] / [{{Create Map Link|KML={{fullurl:GeoJson:{{#titleparts:{{#arrayprint:maintrail}}}}}}?action=raw}} gpsvisualizer Map]}}{{#if:{{filepath:{{#titleparts:{{#arrayprint:maintrail}}}}.kml}}| / Legacy: ([{{filepath:{{#titleparts:{{#arrayprint:maintrail}}}}.kml}} Download KML] / [[:File:{{#arrayprint:maintrail}}.kml|KML File Page]]}})<br /></includeonly> | |||
Latest revision as of 14:02, 27 November 2026
This returns a map of the page's trail (or as set). This version uses/requires Leaflet for the maps and GeoJson for the trail routes.
It should be called in the following format:
{{Trail Map Leaflet|Main Trail={{PAGENAME}}|Other Trails=|Zoom=[any whole number to override zoom]}}
Parameter Main Trail is optional and will default to the pagename. Optionally, additional trails can be requested to have the GeoJson be shown by listing Trail page names separated by semicolons.
Future features could allow specifying map settings.
Edit the page to see the template text.