Template:Trail Map: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
gkml?
m add pressees around legacy part
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>This returns a map of the trails associated with the trail page it is called on.
<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= |Zoom Cancel=[any entry will trigger cancel]}}
{{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 KML be shown by listing Trail page names separated by commas. Lastly, the KML Rezoom command in the map can be overridden by defining anything to Zoom Cancel. Useful for maps where only part of the trail is mapped to not zoom on only it.
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 16: Line 16:
-->{{#arraymerge:alltrailnames|maintrail|othertrailnames}}<!--  
-->{{#arraymerge:alltrailnames|maintrail|othertrailnames}}<!--  
-->{{#ask: [[{{#arrayprint:alltrailnames|{{!}}{{!}}}}||Report:{{PAGENAME}}]]
-->{{#ask: [[{{#arrayprint:alltrailnames|{{!}}{{!}}}}||Report:{{PAGENAME}}]]
| ?Has KML Link
| ?Has GeoJson Page
| pagetitle = hide
| format = array
| format = array
| name = KMLlinks
| name = GJpages
| link=none
| mainlabel=-
| headers=hide
}}<!--  
}}<!--  
-->{{#compound_query:[[{{#arrayprint:alltrailnames|{{!}}{{!}}}}]]
-->{{#compound_query:[[{{#arrayprint:alltrailnames|{{!}}{{!}}}}]]
Line 177: Line 179:
  ;?Has Marker Title
  ;?Has Marker Title
  ;?Has Marker Description
  ;?Has Marker Description
|format=googlemaps
|format=leaflet
|kmlrezoom={{#if: {{{Zoom Cancel|}}}|no|yes}}
|zoom={{{Zoom|}}}
|type=terrain
|fullscreen=on
|types=satellite, hybrid, terrain
|layers=OpenTopoMap, OpenStreetMap
|width=auto
|width=auto
|height=600
|height=600
|link=none
|showtitle=no
|template=Map Balloon Template
|template=Map Balloon Template
|gkml={{#arraymap:{{#arrayprint:KMLlinks}}|,|@@@@|{{#replace:@@@@|<nowiki> </nowiki>|_}}|,}}
|geojson={{#arraymap:{{#arrayprint:GJpages}}|,|@@@@|{{#replace:@@@@|<nowiki> </nowiki>|_}}|;}}
}}
}}
{{#if:{{filepath:{{#titleparts:{{#arrayprint:maintrail}}}}.kml}}|[{{filepath:{{#titleparts:{{#arrayprint:maintrail}}}}.kml}} Download KML] / [{{#replace:https://tehcc.org/clubwiki/index.php?title=Special:Upload&wpDestFile={{#arrayprint:maintrail}}.kml&wpForReUpload=1|<nowiki> </nowiki>|_}} Upload new version] / [[:File:{{#arrayprint:maintrail}}.kml|KML File Page]] / [{{Create Profile Link|KML={{filepath:{{#titleparts:{{#arrayprint:maintrail}}}}.kml}}|Title={{#arrayprint:maintrail}}}} Create Profile Chart] / [{{Create Map Link|KML={{filepath:{{#titleparts:{{#arrayprint:maintrail}}}}.kml}}}} gpsvisualizer Map]|[[File:{{#titleparts:{{#arrayprint:maintrail}}}}.kml{{!}}Upload KML]]}}<br /></includeonly>
[[GeoJson:{{#titleparts:{{#arrayprint:maintrail}}}}|GeoJson Page]]{{#ifexist:GeoJson:{{#titleparts:{{#arrayprint:maintrail}}}}|&nbsp;/ [{{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}}|&nbsp;/ 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.