ClubWiki:Using GMaps: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
(→‎Extension options: more details)
(→‎KML files: Updating for new Maps extension)
Line 41: Line 41:
Before you specify any markers, you can add URL(s) that point to [http://en.wikipedia.org/wiki/Keyhole_Markup_Language KML] files. Each URL should be on its own line, e.g.
Before you specify any markers, you can add URL(s) 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>
  <pre><display_map gkml="http://tehcc.org/clubwiki/kml/Pinnacle_Mountain_Tower_Trail.kml,http://other.url/,...">
<nowiki>http://tehcc.org/clubwiki/kml/Pinnacle_Mountain_Tower_Trail.kml</nowiki>
  </display_map></pre>
<nowiki>http://other.url/</nowiki>
...
<nowiki></googlemap></nowiki>


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.
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.

Revision as of 20:58, 9 August 2015

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

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

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)

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

Before you specify any markers, you can add URL(s) that point to KML files. Each URL should be on its own line, e.g.

<display_map gkml="http://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

Pins are added by using the following syntax within the <googlemap> tags:

lat,lon,balloon title (title will be auto linked to a page on this wiki)
balloon text and/or images, can be multiple lines

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

<googlemap version="0.9" lat="36.500667" lon="-82.47797" type="terrain" zoom="15" width="715" height="350" scale="yes" controls="large">
36.50013,-82.47760,WPSP Sinking Waters
Here is the location of the trail head
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]]
</googlemap>

The above commands can be used many times within a single map to create the pins needed. Note that the version="0.9" option in the googlemap line is required to have these multiline pin entries.

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

Default Pin Icons

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

1. Add the icon address in quotes to the googlemap tag, using icon:

<googlemap lat="36.072635" lon="-79.791975" icon="http://images.wikia.com/walkingdead/images/7/70/Markerfight.png">

Full coding example:

<googlemap lat="36.072635" lon="-79.791975" icon="http://images.wikia.com/walkingdead/images/7/70/Markerfight.png">
38.453857, -84.356461, Rick Grimes Shot
</googlemap>

Custom icons

This site has a list of custom icons that can be used. See the #Icons reference to know which letters will invoke which icon

  1. Add the following extension icons option:
    1. <googlemap lat="36.500667" lon="-82.47797" icons="http://tehcc.org/clubwiki/kml/marker{label}.png">
  2. Prefix the pin coordinates with (X) where 'X' is the letter for the pin icon desired
    1. (G) 36.502891,-82.468700

Full coding of a custom icon map:

<googlemap lat="36.500667" lon="-82.47797"width="715" height="350" icons="http://tehcc.org/clubwiki/kml/marker{label}.png">
(E) 36.50013,-82.47760
Fall Creek Falls
[[Image:WPSP Fall Creek Falls.jpg|150px|Fall Creek Falls]]
(A) 36.502632,-82.482759
Parking along Fall Creek Road
(G) 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]]
</googlemap>

Icons reference

Icons in use at this site

Letter Icon Meaning
A http://tehcc.org/clubwiki/kml/markerA.png Parking
B http://tehcc.org/clubwiki/kml/markerB.png Picturesque location
C http://tehcc.org/clubwiki/kml/markerC.png Waterfall
D http://tehcc.org/clubwiki/kml/markerD.png Alternate for picturesque
E http://tehcc.org/clubwiki/kml/markerE.png Overlook
F http://tehcc.org/clubwiki/kml/markerF.png Shelter
G http://tehcc.org/clubwiki/kml/markerG.png Trailhead/intersection/point of interest
H http://tehcc.org/clubwiki/kml/markerH.png Campground
I http://tehcc.org/clubwiki/kml/markerI.png Cave
J http://tehcc.org/clubwiki/kml/markerJ.png Water crossing - no bridge - rock-hopping
K http://tehcc.org/clubwiki/kml/markerK.png Bench
L http://tehcc.org/clubwiki/kml/markerL.png Trail bridge
M http://tehcc.org/clubwiki/kml/markerM.png Cell Tower/Antenna
N http://tehcc.org/clubwiki/kml/markerN.png Cemetery
O http://tehcc.org/clubwiki/kml/markerO.png Playground
Q http://tehcc.org/clubwiki/kml/markerQ.png Toilet
R http://tehcc.org/clubwiki/kml/markerR.png Tunnel
S http://tehcc.org/clubwiki/kml/markerS.png Picnic Area

Search http://mapicons.nicolasmollet.com/ for other icons to suggest, send to webmaster for inclusion

Examples

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