ClubWiki:Using GMaps: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
m (→‎Icons reference: Added column for meaning)
m (Text replacement - "http://tehcc.org/clubwiki/" to "https://tehcc.org/clubwiki/")
 
(47 intermediate revisions by 4 users not shown)
Line 1: Line 1:
In many cases you can get by using the [[Extension:Google Maps/Editor's Map|Editor's Map]], but understanding the underlying coding of the Google maps extension will unlock a few extra features for you.
This wiki site uses a MediaWiki extension called Maps. It's full syntax description can be found at its [https://www.semantic-mediawiki.org/wiki/Category:Maps_examples home site]. Here we will just describe the basic features typically used for this site for simplicity for our users.
 
== Basic use ==
The map is invoked by using the following basic structure
<pre>
<display_map options and KML links>
(optional and multiple possible) pin locations
</display_map>
</pre>
 
This site prefers that routes/trails are kept in the KMLs and the pins/markers are specified within the wiki markup on the page. By keeping the pins specified in the wiki markup, it is easier for users of this site to add/remove/modify them.
 
The specifics of each portion are explained below


== Extension options ==
== Extension options ==
Available coding options are:
Available coding options are (full list [https://www.semantic-mediawiki.org/wiki/Help:Google_Maps_format here]):


* width (in pixels; default is 740)
* center (location which can be coordinates or place name but place names slows page render; default is centered on all listed pins)
* height (in pixels; default is 600)
* width (assumes pixels by default but can also be ex, em, %; default is auto)
* lat (the center latitude on the map)
* height (assumes pixels by default but can also be ex, em, %; default is 350)
* lon (the center longitude on the map)
* zoom (the zoom level; 0 is the furthest away, 21 is the closest in; 15 is closest zoom for terrain)
* zoom (the zoom level; 0 is the furthest away, 21 is the closest in)
* type ("terrain" or "roadmap", "hybrid", or "satellite"; default is "roadmap")
* type ("normal" or "map", "hybrid", or "satellite"; default is "hybrid")
* controls (controls to place on the map, list any/all pan, zoom, type, scale, streetview)
* controls (''small'' creates +/- zoom buttons, ''medium'' has zoom buttons and pan buttons, ''large'' has pan buttons with a sliding scale for zoom, and ''none'' has no buttons)
* zoomstyle (not sure yet, but I think we want this for small vs. large maps)
* selector (show the map/hybrid/satellite selector? ''yes'' (default) and ''no''.)
* typestyle (not sure yet, but I think we want this for small vs. large maps)
* scale (show the distance scale? ''yes'' and ''no'' (default).)
* kmlrezoom (yes/no center on drawn kmls; default is no)
* overview (show the inset navigation map? ''yes'' and ''no'' (default).)
* gkml (list URLs to kmls separated by a comma)
* icons (web address if the marker icon  is customized. With "{label}" where the name of the icon will be inserted; defaults to "<nowiki>http://maps.google.com/mapfiles/marker{label}.png</nowiki>")
* markercluster (automatically groups crowded pins and zooms on click; default no)
* icon (web address if the marker icon is not specified; the default icon is [http://maps.google.com/mapfiles/marker.png http://maps.google.com/mapfiles/marker.png])
* icon (Default icon to use for all markers/pins - only can apparently use an image on this site without the "File:" prefix)
* units ("meters" or "miles"; default is "meters".)


All attributes are optional.
All attributes are optional. If it is not specified the above described default will be assumed.


So the final code might be:
So the final code to place just a map with no other features might be:


<pre>
<pre>
<googlemap lat="52.523777" lon="13.411896" zoom="12" width="500" height="400" type="map" controls="small">
<display_map center="Warriors Path State Park, TN" zoom="12" width="50%" height="200" type="terrain" controls="scale,type">
52.499683,13.333907,Kaiser Wilhelm Memorial Church
</display_map>
52.510019,13.369893,Berlin Philharmonie
</googlemap>
</pre>
</pre>
<display_map center="Warriors Path State Park, TN" zoom="12" width="50%" height="200" type="terrain" controls="scale,type">
</display_map>


== Icons ==
== KML files ==
:''See [http://mapki.com/wiki/Icon_Image_Sets Mapki's collection of icon images] for a several icons you can use.''
KMLs are now specified within the open command. Using the kml (not sure when this is used) or gkml (the one we seem to need to use) you can add URL(s) that point to [http://en.wikipedia.org/wiki/Keyhole_Markup_Language KML] files. Each URL should be separated by a comma.
:''See [http://www.awaycity.com/wiki/Dublin/Swimming Awaycity Swimming] for an example of how to use icons.''


You can create your own collection of icons (markers) on your server.<ref>These icons have the same anchor points as Google's default icons. For example, markerA will also be named markerA. </ref>
<pre><display_map gkml="https://tehcc.org/clubwiki/kml/Pinnacle_Mountain_Tower_Trail.kml,http://other.url/,...">
</display_map></pre>


;Change the Google Maps default icon
These files will be dynamically imported into the map each time the map is loaded. For now, any new KMLs must be emailed to the [mailto:webmaster@tehcc.org webmaster] for uploading to the site.  These are kept in the above referenced (tehcc.org/clubwiki/kml) folder. Another warning is to avoid spaces in the KML title as these will not properly link, so use underscores or hyphens to connect the words.
1. Add the icon address in quotes the googlemap tag, using '''icon''':
<nowiki><googlemap lat="36.072635" lon="-79.791975" icon="http://images.wikia.com/walkingdead/images/7/70/Markerfight.png"></nowiki>


Full coding:
== Pins ==
<nowiki><googlemap lat="36.072635" lon="-79.791975" icon="http://images.wikia.com/walkingdead/images/7/70/Markerfight.png"></nowiki>
Pins are added by using the following syntax within the <nowiki><display_map></nowiki> tags. The different attributes of the pin are separated by tildes (~).
38.453857, -84.356461, Rick Grimes Shot
<nowiki></googlemap></nowiki>


;Custom icons
<pre>
Location~Title~Details~Icon~Visited Icon?~Label~???
location ~ balloon title ~ balloon contents ~ Map Icon (wiki file) ~ Visited Map icon (wiki file) ~ label(shows next to pin at all times)~ something else?
</pre>


1. Name the pictures with names such as:  
Full coding showing two pins, the first with a linked title and regular text with a persistent label and the second with no linked title but regular text and a small image:
:marker(letter of alphabet).png.  
<pre>
:For example, markerA.png to create the "A" marker, markerC.png to create the "C" marker, markerR.png to create the "R" marker, etc
<display_map center="36.500667,-82.47797" type="terrain" zoom="15" width="715" height="350">
36.50013,-82.47760~[[WPSP Sinking Waters|Sinking Waters]]~Here is the location of the trail head~MarkerA.png~ ~This is where Putin Works
36.502891,-82.468700~Connection~Intersection to/from [[WPSP_Fall_Creek_Loop_Trail|Fall Creek Loop]]<br>[[Image:To D Backbone Trail.jpg|150px|Trail head sign]]
</display_map>
</pre>
 
<display_map center="36.500667,-82.47797" type="terrain" zoom="15" width="715" height="350">
36.50013,-82.47760~[[WPSP Sinking Waters|Sinking Waters]]~Here is the location of the trail head~MarkerA.png~ ~This is where Putin Works
36.502891,-82.468700~Connection~Intersection to/from [[WPSP_Fall_Creek_Loop_Trail|Fall Creek Loop]]<br>[[Image:To D Backbone Trail.jpg|150px|Trail head sign]]
</display_map>
 
The above commands can be used many times within a single map to create the pins needed.


2. Upload the pictures which will serve as the icons to your server.  
== Pin icons ==
Icons can be changed by two methods, changing all undefined icons to a specified one or invoking the custom icon list used on this site and then specifying pin by pin which icon to display for the pin. Custom icons are referenced using an image on the wiki without the "File:" prefix (e.g. MarkerA.png)


3. Add the icons coding in quotes the googlemap tag, using '''icons''':
=== Default Pin Icons ===
<nowiki><googlemap lat="53.35506" lon="-6.276283" icons="http://www.awaycity.com/images/mapfiles/marker{label}.png"></nowiki>
The default icon used for pins can be changed by adding an icon command in the extension options:


Full coding:
Add the icon address in quotes to the displat_map tag, using '''icon''':  
<nowiki><googlemap lat="53.35506" lon="-6.276283" icons="http://www.awaycity.com/images/mapfiles/marker{label}.png"></nowiki>
<pre><display_map icon=MarkerG.png>
(B) 53.422237547104515, -6.2295109033584595, ALSAA - Aer Lingus Swimming Pool
38.453857,-84.356461~Rick Grimes Shot
Membership required
38.462857,-84.365461~Rick Grimes Shot
(A) 53.34089264525343, -6.357307434082031, Ballyfermot Swimming Pool (Sean Dunne)
38.444857,-84.347461~Rick Grimes Shot
Membership required
</display_map></pre>
(Z) 53.325577, -6.265393, Rathmines Swimming Pool
Closed. Expected completion date: November 2009
(F) 53.36863302821816, -6.14659309387207, Bull Island Beach
<nowiki></googlemap></nowiki>


=== Icons reference ===
<display_map icon=MarkerG.png>
38.453857,-84.356461~Rick Grimes Shot
38.462857,-84.365461~Rick Grimes Shot
38.444857,-84.347461~Rick Grimes Shot
</display_map>
 
=== Custom icons ===
Custom icons are defined as the fourth of the pin parameters. This site has a list of custom icons that can be used. See the [[#Icons reference]] to know which letters will invoke which icon
 
Full coding of a custom icon map:
<pre>
<display_map width="auto" height="350">
36.50013,-82.47760~Fall Creek Falls~[[Image:WPSP Fall Creek Falls.jpg|150px|Fall Creek Falls]]~MarkerE.png
36.502632,-82.482759~Parking along Fall Creek Road~ ~MarkerA.png
36.502891,-82.468700~Intersection to/from [[WPSP_Fall_Creek_Loop_Trail|Fall Creek Loop]]~[[Image:To D Backbone Trail.jpg|150px|Trail head sign]]~MarkerG.png
</display_map>
</pre>
 
<display_map width="auto" height="350">
36.50013,-82.47760~Fall Creek Falls~[[Image:WPSP Fall Creek Falls.jpg|150px|Fall Creek Falls]]~MarkerE.png
36.502632,-82.482759~Parking along Fall Creek Road~ ~MarkerA.png
36.502891,-82.468700~Intersection to/from [[WPSP_Fall_Creek_Loop_Trail|Fall Creek Loop]]~[[Image:To D Backbone Trail.jpg|150px|Trail head sign]]~MarkerG.png
</display_map>
 
==== Icons reference ====
Icons in use at this site
Icons in use at this site
{| class="wikitable" style="text-align: left; border=1"
{| class="wikitable" style="text-align: left; border=1"
!Letter
!Filename
!Icon
!Icon
!Meaning
!Meaning
!Name used in icon lists
|----
|----
|A
|MarkerA.png
|http://tehcc.org/clubwiki/kml/markerA.png
|[[File:MarkerA.png]]
|Parking
|Parking
|Parking
|----
|----
|B
|MarkerB.png
|http://tehcc.org/clubwiki/kml/markerB.png
|[[File:MarkerB.png]]
|Picturesque location
|Picturesque location
|Photo spot
|----
|----
|C
|MarkerC.png
|http://tehcc.org/clubwiki/kml/markerC.png
|[[File:MarkerC.png]]
|Waterfall
|Waterfall
|Waterfall
|----
|----
|D
|MarkerD.png
|http://tehcc.org/clubwiki/kml/markerD.png
|[[File:MarkerD.png]]
|
|Alternate for picturesque
|Other photo spot
|----
|----
|E
|MarkerE.png
|http://tehcc.org/clubwiki/kml/markerE.png
|[[File:MarkerE.png]]
|Overlook
|Overlook
|Overlook
|----
|----
|F
|MarkerF.png
|http://tehcc.org/clubwiki/kml/markerF.png
|[[File:MarkerF.png]]
|Shelter
|Shelter
|Shelter
|----
|MarkerG.png
|[[File:MarkerG.png]]
|Trailhead/intersection/point of interest
|Point of interest
|----
|----
|G
|MarkerH.png
|http://tehcc.org/clubwiki/kml/markerG.png
|[[File:MarkerH.png]]
|Campground
|Campground
|Campground
|----
|----
|H
|MarkerI.png
|http://tehcc.org/clubwiki/kml/markerH.png
|[[File:MarkerI.png]]
|
|Cave
|----
|I
|http://tehcc.org/clubwiki/kml/markerI.png
|Cave
|Cave
|----
|----
|J
|MarkerJ.png
|http://tehcc.org/clubwiki/kml/markerJ.png
|[[File:MarkerJ.png]]
|Water crossing - no bridge - rock-hopping
|Water crossing
|Water crossing
|----
|MarkerK.png
|[[File:MarkerK.png]]
|Bench
|Bench
|----
|MarkerL.png
|[[File:MarkerL.png]]
|Trail bridge
|Trail bridge
|----
|MarkerM.png
|[[File:MarkerM.png]]
|Cell Tower/Antenna
|Comm tower
|----
|MarkerN.png
|[[File:MarkerN.png]]
|Cemetery
|Cemetery
|----
|MarkerO.png
|[[File:MarkerO.png]]
|Playground
|Playground
|----
|MarkerP.png
|[[File:MarkerP.png]]
|Summit Marker
|Summit
|----
|MarkerQ.png
|[[File:MarkerQ.png]]
|Toilet
|Toilet
|----
|MarkerR.png
|[[File:MarkerR.png]]
|Tunnel
|Tunnel
|----
|MarkerS.png
|[[File:MarkerS.png]]
|Picnic Area
|Picnic spot
|----
|MarkerT.png
|[[File:MarkerT.png]]
|Trail intersection signpost
|Trail sign
|----
|MarkerU.png
|[[File:MarkerU.png]]
|Trail road crossing
|Road crossing
|----
|MarkerV.png
|[[File:MarkerV.png]]
|Old abandoned structure or foundation
|Old structure
|----
|MarkerW.png
|[[File:MarkerW.png]]
|Horseback riding
|Horseback
|----
|MarkerX.png
|[[File:MarkerX.png]]
|Alien capsule(?!)
|Alien landing
|----
|MarkerY.png
|[[File:MarkerY.png]]
|Rest spot
|Rest
|----
|Marker1.png
|[[File:Marker1.png]]
|Skiing
|Skiing
|----
|Marker2.png
|[[File:Marker2.png]]
|Tower (fire tower - It was the best that could be found)
|Tower
|----
|powerline.png
|[[File:powerline.png]]
|Power Line
|Power line
|----
|treedown.png
|[[File:treedown.png]]
|Blowdowns on trail
|Blowdown
|----
|Rangerstation.png
|[[File:Rangerstation.png]]
|Park ranger station, HQ, or visitor's center
|Rangerstation
|----
|----
|}
|}
The following sites have been useful for icons. The first are in the format typically used on this site for map pins. The second are shapes that can be made to appear like the first (for consistency)
*http://mapicons.nicolasmollet.com/
*https://www.iconsdb.com/


== Using <nowiki><googlemap></nowiki> in a template ==
== Examples ==
 
Review the markup for these pages for good examples of embedded Google Maps, using most or all of the features described above
If you would like to put a map inside a [[template]], then you will need to use a slightly different coding to get the coding to work properly.
*[[Warriors Path State Park]] - Shows multiple KML files in use
 
*[[WPSP Devil's Backbone|Devil's Backbone]] - Multiple KML files and many pins showing pictures and more
The following is an example for including a map ''without'' markers.
 
BAD:
 
<nowiki><googlemap lat="{{{1}}}" lon="{{{2}}}"></nowiki>
 
GOOD:
 
<nowiki>{{#tag:googlemap|lat={{{1}}} lon={{{2}}}}}</nowiki>
 
This <nowiki>#tag</nowiki> technique only works with MediaWiki 1.12 and later.
 
if the above does not work, try
<pre>
<nowiki>
{{#tag:googlemap
|lat={{{1}}}
|lon={{{2}}}
}}</nowiki>
</pre>
 
== KML export ==
 
Beginning with version 0.9.0, there is a new tag called <code>googlemapkml</code>. This allows a visitor to your wiki to export (download to their computer) all of the maps on the current page to a [http://en.wikipedia.org/wiki/Keyhole_Markup_Language KML] file by clicking a link.<ref>The contents of the tag are the contents of the link.</ref> For example:
 
<nowiki><googlemapkml>Download KML</googlemapkml></nowiki>
 
[[File:Kml.PNG|300px|right|thumb|Pop up box asking the user to download the kml coding to their desktop. In this example, all the KML map coding from the page "Locations" will be downloaded]]
To allow readers to export (download) the KML coding from your map, use the "article" attribute, for example:
 
:<nowiki><googlemapkml article="Chicago">View in Google Earth</googlemapkml></nowiki>
 
This creates the link "View in Google Earth"
 
If the user clicks the link, "View in Google Earth", it opens a download pop up box, and downloads all the maps on your Chicago page to their computer.
{{-}}
==== KML import - export ====
Say for example, you have a wiki about a town. You have a map with theaters and a map with bus stations. You can merge these maps together, so that a visitor to your wiki can select which markers they would like to see (either from the theater map, from the bus stations map or both).
 
It is possible to merge the maps of some other articles within a new article’s map, but you must use the full url of GoogleMapsKML.
 
:<nowiki><googlemap></nowiki>
:<nowiki>http://your.wiki.url/index.php?title=Special:GoogleMapsKML&article=a_article</nowiki>
:<nowiki>http://your.wiki.url/index.php?title=Special:GoogleMapsKML&article=another_article</nowiki>
:...
:<nowiki></googlemap></nowiki>
 
== Map coding version "0" (default) ==
 
This section describes the "old coding", which is enabled by default. To force its use, set <code>version="0"</code> in the map attributes.
 
=== Markers ===
 
In the content of the tag, you can define one marker per line.
* Each line can optionally start with an '''icon''' name in parentheses; unless you set the "icons" attribute, icon names are the upper-case letters of the alphabet. ''example: (S)''
* the '''latitude''', then a comma, optionally a space, ''example: 42.711618,''
* then the '''longitude''', then a comma, ''example: -73.205112,''
* then the '''text for the pop up information balloon'''. The label can include wiki coding (and commas) ''example: The fabulous, famous <nowiki>[[Sawyer Library]]</nowiki>''
 
For example:
 
<googlemap lat="42.711618" lon="-73.205112" zoom="2" controls="small">
<nowiki>42.711618,-73.205112,the fabulous, famous [[Sawyer Library]]</nowiki>
<nowiki>42.711618, -73.205112, the fabulous, famous [[Sawyer Library]]</nowiki>
<nowiki>(S) 42.711618, -73.205112, the fabulous, famous [[Sawyer Library]]</nowiki>
</googlemap>
 
=== Paths ===
 
''This feature must first be enabled on your wiki; see [[Extension:Google Maps/Installation#Colored paths]]''
 
To connect multiple points with a colored path, start the line with a color in RGB hex format., for example:
 
<nowiki>#330000</nowiki>
<nowiki>42.711618,-73.205112</nowiki>
<nowiki>42.714779,-73.204544</nowiki>
 
This will connect the two points with a colored line. Any points not on a line should appear before all points on lines. For example:
 
42.711618, -73.25112, this point is not on a line
43.224024, -70.28301, neither is this one
#770077
42.202452, -72.83101, this is on a line of color #77077
45.214425, -72.48114, so is this
#668800
42.201324, -70.95811, this starts a second line
43.404142, -73.44514, this is also on the second line
Any text on the same line as, but appearing after, the color specification will be ignored.
 
You'll probably want to use the [[Extension:Google Maps/Editor's Map]] to generate this coding.
 
=== Areas ===
 
'''New in 0.8'''
 
Areas are enclosed paths with a colored filling. The coding is just like a path, except that the interior color should be specified in parentheses after the path color, like this:
 
#770077 (#668800)
 
=== Tabs ===
 
'''New in 0.7'''
 
A feature new to 0.7 are tabbed info balloons. Each tab should have a plain-text title surrounded by inward-leaning slashes (like /this\) followed by a caption that can include wiki mark-up. Tabs will be attached to the previous marker. Example:
 
  45.214425, -72.48114
  <nowiki>/Info\      This is where Ulysses Grant is buried</nowiki>
  <nowiki>/Directions\ [http://maps.google.com Click here] to get driving directions</nowiki>
 
That will create a point whose info balloon has two tabs. Note that you can put as much or as little space as you'd like between the title and the caption to make the coding more readable.
 
If a point has a regular caption ''and'' tabbed captions, clicking the point will only show the tabbed captions.
 
== Map coding version "0.9" ==
 
Starting with release 0.9.0, a new map coding is available. It differs only slightly from version "0". To use the new coding, you will need to set <code>version="0.9"</code> in the map attributes (the Editor's Map will do this for you). Benefits include:
 
* Multiline captions
* Specify opacity
* Titles that appear on mouse-over
 
The new coding is described below.
 
=== KML import ===
 
Before you specify any markers, you can add URLs that point to [http://en.wikipedia.org/wiki/Keyhole_Markup_Language KML] files. Each URL should be on its own line, e.g.
 
<nowiki><googlemap></nowiki>
<nowiki>http://some.url/</nowiki>
<nowiki>http://other.url/</nowiki>
...
<nowiki></googlemap></nowiki>
 
These files will be dynamically imported into the map each time the map is loaded.
 
=== Markers and Tabs ===
Markers can be specified in several ways:
 
No caption, just a point:
42.711618, -73.205112
 
A marker labeled "S":
(S) 42.711618, -73.205112
 
A title but no caption. The title can NOT contain wiki markup. It is displayed when a user mouses over the marker:
42.711618, -73.205112, Sawyer Library
 
Title plus a caption. The caption appears when a user clicks on the marker:
42.711618, -73.205112, Sawyer Library
<nowiki>[[Sawyer Library]], built in 1977</nowiki>
 
A caption can span multiple lines. However, the title is still optional, so this is okay too:
 
42.711618, -73.205112
<nowiki>[[Sawyer Library]], built in 1977</nowiki>
 
Finally, you can also create tabs. A tab's title should appear between inward facing slashes(/ and \). The content of a tab should be on a new line and can span multiple lines, just like captions.
 
latitude, longitude, title
/tab1\
caption1
/tab2\
caption2
...
 
=== Paths and Areas ===
 
You can connect multiple points  with a color line. However, in version 0.9.0., the color must now include '''opacity''' and '''width''' information, for example:
 
<nowiki>6#FF330000</nowiki>
 
 
In the example above the width is 6 pixel's wide, the opacity is #FF (opaque) and the color is #330000.
 
The ''6'' means that the path will be 6 pixels wide. The first two hex digits specify the opacity from #00 (transparent) to #FF (opaque). The final 6 hex digits are a "web color", for example #RRGGBB.
 
 
Similarly for areas, the interior color should be 8 digits instead of 6; the first two digits define the opacity, for example:
 
6#770077 (#BB668800)
==Advanced coding==
===Create a map list===
[[File:The walking dead google maps screenshot.png|400px|right|thumb|Google map, showing text in the list is the same in the info balloon]]
Google maps creates a list of all information in the info balloons.
{{-}}
[[File:Google maps list of all items in the template.png|right|thumb|400px|Text in the list is the same as text in the info balloons in google maps, and changes as the info balloon information changes]]
With Google Maps extension, a side by side list of all maps locations and descriptions, which changes when you edit Google maps, is also possible with advanced templates.
 
This list is possible with three templates:
# [http://walkingdead.wikia.com/wiki/Template:Map Map template with all information which appears in the map and list]
# [http://walkingdead.wikia.com/wiki/Template:Maptable List template which pulls the information from the map template]
# [http://walkingdead.wikia.com/wiki/Template:Markers A template which explains the rules the templates follow and the formatting]
 
For the coding to do this, see the edit pages of the above links, or [[Extension:Google Maps/Syntax/list]]
 
===Changing the size of the balloon===
To change the size of the pop-up info balloon, put the contents of the info window into a custom div.  For example:


<nowiki><div style="min-width: 120px; min-height: 120px;"> Text for balloon </div></nowiki>
== Unexplored Features ==
Here's a list of new capabilities of the map extension that haven't been explored yet but sounds possibly useful for this site
* Drawing of lines, circles, and polygons on a map using coordinates within the tag - information [http://semantic-mediawiki.org/wiki/Maps_examples/Google_Maps_shapes here]
* Polygons on hover over a defined area - information [http://semantic-mediawiki.org/wiki/Maps_examples/Google_Maps_polygons_on_hover here]
* Searching within markers (although their examples don't seem to work - information [http://semantic-mediawiki.org/wiki/Maps_examples/Google_Maps_searchmarkers here]
* Fusion tables(???)
* [[Special:MapEditor|Map Editor]] to create lines, polygons, pin placements, etc.
* Dynamic tables and maps by searching created pages - See example [https://wiki.hackerspaces.org/Category:Pages_with_a_map_rendered_by_the_Maps_extension here] that maps and lists based on individual pages (I would really like this for both the master trails list and map but could also be a good way to handle parks with several trails)

Latest revision as of 12:12, 7 January 2023

This wiki site uses a MediaWiki extension called Maps. It's full syntax description can be found at its home site. Here we will just describe the basic features typically used for this site for simplicity for our users.

Basic use[edit]

The map is invoked by using the following basic structure

<display_map options and KML links>
(optional and multiple possible) pin locations
</display_map>

This site prefers that routes/trails are kept in the KMLs and the pins/markers are specified within the wiki markup on the page. By keeping the pins specified in the wiki markup, it is easier for users of this site to add/remove/modify them.

The specifics of each portion are explained below

Extension options[edit]

Available coding options are (full list here):

  • center (location which can be coordinates or place name but place names slows page render; default is centered on all listed pins)
  • width (assumes pixels by default but can also be ex, em, %; default is auto)
  • height (assumes pixels by default but can also be ex, em, %; default is 350)
  • zoom (the zoom level; 0 is the furthest away, 21 is the closest in; 15 is closest zoom for terrain)
  • type ("terrain" or "roadmap", "hybrid", or "satellite"; default is "roadmap")
  • controls (controls to place on the map, list any/all pan, zoom, type, scale, streetview)
  • zoomstyle (not sure yet, but I think we want this for small vs. large maps)
  • typestyle (not sure yet, but I think we want this for small vs. large maps)
  • kmlrezoom (yes/no center on drawn kmls; default is no)
  • gkml (list URLs to kmls separated by a comma)
  • markercluster (automatically groups crowded pins and zooms on click; default no)
  • icon (Default icon to use for all markers/pins - only can apparently use an image on this site without the "File:" prefix)

All attributes are optional. If it is not specified the above described default will be assumed.

So the final code to place just a map with no other features might be:

<display_map center="Warriors Path State Park, TN" zoom="12" width="50%" height="200" type="terrain" controls="scale,type">
</display_map>
Loading map...

KML files[edit]

KMLs are now specified within the open command. Using the kml (not sure when this is used) or gkml (the one we seem to need to use) you can add URL(s) that point to KML files. Each URL should be separated by a comma.

<display_map gkml="https://tehcc.org/clubwiki/kml/Pinnacle_Mountain_Tower_Trail.kml,http://other.url/,...">
</display_map>

These files will be dynamically imported into the map each time the map is loaded. For now, any new KMLs must be emailed to the webmaster for uploading to the site. These are kept in the above referenced (tehcc.org/clubwiki/kml) folder. Another warning is to avoid spaces in the KML title as these will not properly link, so use underscores or hyphens to connect the words.

Pins[edit]

Pins are added by using the following syntax within the <display_map> tags. The different attributes of the pin are separated by tildes (~).

Location~Title~Details~Icon~Visited Icon?~Label~???
location ~ balloon title ~ balloon contents ~ Map Icon (wiki file) ~ Visited Map icon (wiki file) ~ label(shows next to pin at all times)~ something else?

Full coding showing two pins, the first with a linked title and regular text with a persistent label and the second with no linked title but regular text and a small image:

<display_map center="36.500667,-82.47797" type="terrain" zoom="15" width="715" height="350">
36.50013,-82.47760~[[WPSP Sinking Waters|Sinking Waters]]~Here is the location of the trail head~MarkerA.png~ ~This is where Putin Works
36.502891,-82.468700~Connection~Intersection to/from [[WPSP_Fall_Creek_Loop_Trail|Fall Creek Loop]]<br>[[Image:To D Backbone Trail.jpg|150px|Trail head sign]]
</display_map>
Loading map...

The above commands can be used many times within a single map to create the pins needed.

Pin icons[edit]

Icons can be changed by two methods, changing all undefined icons to a specified one or invoking the custom icon list used on this site and then specifying pin by pin which icon to display for the pin. Custom icons are referenced using an image on the wiki without the "File:" prefix (e.g. MarkerA.png)

Default Pin Icons[edit]

The default icon used for pins can be changed by adding an icon command in the extension options:

Add the icon address in quotes to the displat_map tag, using icon:

<display_map icon=MarkerG.png>
38.453857,-84.356461~Rick Grimes Shot
38.462857,-84.365461~Rick Grimes Shot
38.444857,-84.347461~Rick Grimes Shot
</display_map>
Loading map...

Custom icons[edit]

Custom icons are defined as the fourth of the pin parameters. This site has a list of custom icons that can be used. See the #Icons reference to know which letters will invoke which icon

Full coding of a custom icon map:

<display_map width="auto" height="350">
36.50013,-82.47760~Fall Creek Falls~[[Image:WPSP Fall Creek Falls.jpg|150px|Fall Creek Falls]]~MarkerE.png
36.502632,-82.482759~Parking along Fall Creek Road~ ~MarkerA.png
36.502891,-82.468700~Intersection to/from [[WPSP_Fall_Creek_Loop_Trail|Fall Creek Loop]]~[[Image:To D Backbone Trail.jpg|150px|Trail head sign]]~MarkerG.png
</display_map>
Loading map...

Icons reference[edit]

Icons in use at this site

Filename Icon Meaning Name used in icon lists
MarkerA.png MarkerA.png Parking Parking
MarkerB.png MarkerB.png Picturesque location Photo spot
MarkerC.png MarkerC.png Waterfall Waterfall
MarkerD.png MarkerD.png Alternate for picturesque Other photo spot
MarkerE.png MarkerE.png Overlook Overlook
MarkerF.png MarkerF.png Shelter Shelter
MarkerG.png MarkerG.png Trailhead/intersection/point of interest Point of interest
MarkerH.png MarkerH.png Campground Campground
MarkerI.png MarkerI.png Cave Cave
MarkerJ.png MarkerJ.png Water crossing - no bridge - rock-hopping Water crossing
MarkerK.png MarkerK.png Bench Bench
MarkerL.png MarkerL.png Trail bridge Trail bridge
MarkerM.png MarkerM.png Cell Tower/Antenna Comm tower
MarkerN.png MarkerN.png Cemetery Cemetery
MarkerO.png MarkerO.png Playground Playground
MarkerP.png MarkerP.png Summit Marker Summit
MarkerQ.png MarkerQ.png Toilet Toilet
MarkerR.png MarkerR.png Tunnel Tunnel
MarkerS.png MarkerS.png Picnic Area Picnic spot
MarkerT.png MarkerT.png Trail intersection signpost Trail sign
MarkerU.png MarkerU.png Trail road crossing Road crossing
MarkerV.png MarkerV.png Old abandoned structure or foundation Old structure
MarkerW.png MarkerW.png Horseback riding Horseback
MarkerX.png MarkerX.png Alien capsule(?!) Alien landing
MarkerY.png MarkerY.png Rest spot Rest
Marker1.png Marker1.png Skiing Skiing
Marker2.png Marker2.png Tower (fire tower - It was the best that could be found) Tower
powerline.png Powerline.png Power Line Power line
treedown.png Treedown.png Blowdowns on trail Blowdown
Rangerstation.png Rangerstation.png Park ranger station, HQ, or visitor's center Rangerstation

The following sites have been useful for icons. The first are in the format typically used on this site for map pins. The second are shapes that can be made to appear like the first (for consistency)

Examples[edit]

Review the markup for these pages for good examples of embedded Google Maps, using most or all of the features described above

Unexplored Features[edit]

Here's a list of new capabilities of the map extension that haven't been explored yet but sounds possibly useful for this site

  • Drawing of lines, circles, and polygons on a map using coordinates within the tag - information here
  • Polygons on hover over a defined area - information here
  • Searching within markers (although their examples don't seem to work - information here
  • Fusion tables(???)
  • Map Editor to create lines, polygons, pin placements, etc.
  • Dynamic tables and maps by searching created pages - See example here that maps and lists based on individual pages (I would really like this for both the master trails list and map but could also be a good way to handle parks with several trails)