ClubWiki:Using GMaps: Difference between revisions
(→Icons reference: Added more) |
(major rewrite/simplification for our site's use) |
||
Line 1: | Line 1: | ||
This wiki site uses a MediaWiki extension called Google Maps. It's full syntax description can be found at its [http://www.mediawiki.org/wiki/Extension:Google_Maps/Syntax home site]. Here we will just describe the basic features typically used for this site for simplicity for our users | |||
== Basic use == | |||
The Google map is invoked by using the following basic structure | |||
<pre> | |||
<googlemap options> | |||
(optional and multiple possible) KML file locations | |||
(optional and multiple possible) pin locations | |||
</googlemap> | |||
</pre> | |||
This site prefers that routes/trails are kept in the KMLs and the pins/markers are specified within the extension on this site. 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 == | ||
Line 14: | Line 27: | ||
* scale (show the distance scale? ''yes'' and ''no'' (default).) | * scale (show the distance scale? ''yes'' and ''no'' (default).) | ||
* overview (show the inset navigation map? ''yes'' and ''no'' (default).) | * overview (show the inset navigation map? ''yes'' and ''no'' (default).) | ||
* icons (web address if the marker icon | * 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>") | ||
* 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 (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]) | ||
* units ("meters" or "miles"; default is "meters".) | * 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=" | <googlemap lat="36.500667" lon="-82.47797" zoom="12" width="500" height="400" type="map" controls="small"> | ||
</googlemap> | </googlemap> | ||
</pre> | </pre> | ||
== | == KML files == | ||
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> | |||
<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. For now any new KMLs must be emailed to the [mailto:webmaster@tehcc.org webmaster] for uploading to the site. | |||
== Pins == | |||
Pins are added by using the following syntax within the <nowiki><googlemap></nowiki> tags: | |||
<pre> | |||
lat,lon,balloon title (title will be auto linked to a page on this wiki) | |||
balloon text and/or images, can be multiple lines | |||
</pre> | |||
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: | |||
<pre><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]]</pre> | |||
The above commands can be used many times within a single map to create the pins needed | |||
== Pin icons == | |||
1. Add the icon address in quotes the googlemap tag, using '''icon''': | 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''': | |||
<nowiki><googlemap lat="36.072635" lon="-79.791975" icon="http://images.wikia.com/walkingdead/images/7/70/Markerfight.png"></nowiki> | <nowiki><googlemap lat="36.072635" lon="-79.791975" icon="http://images.wikia.com/walkingdead/images/7/70/Markerfight.png"></nowiki> | ||
Line 44: | Line 82: | ||
<nowiki></googlemap></nowiki> | <nowiki></googlemap></nowiki> | ||
=== 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 | |||
#Add the following extension '''icons''' option: | |||
##<nowiki><googlemap lat="36.500667" lon="-82.47797" icons="http://tehcc.org/clubwiki/kml/marker{label}.png"></nowiki> | |||
#Prefix the pin coordinates with (X) where 'X' is the letter for the pin icon desired | |||
##<nowiki>(G) 36.502891,-82.468700</nowiki> | |||
Full coding of a custom icon map: | |||
<pre><googlemap version="0.9" lat="36.500667" lon="-82.47797" type="terrain" zoom="15" width="715" height="350" scale="yes" controls="large" 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]]</pre> | |||
==== Icons reference ==== | |||
=== 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" | ||
Line 143: | Line 178: | ||
|} | |} | ||
Search http://code.google.com/p/google-maps-icons/ for other icons to suggest, send to [mailto:webmaster@tehcc.org webmaster] for inclusion | Search http://code.google.com/p/google-maps-icons/ for other icons to suggest, send to [mailto:webmaster@tehcc.org webmaster] for inclusion | ||
Revision as of 22:32, 9 April 2011
This wiki site uses a MediaWiki extension called Google 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 Google map is invoked by using the following basic structure
<googlemap options> (optional and multiple possible) KML file locations (optional and multiple possible) pin locations </googlemap>
This site prefers that routes/trails are kept in the KMLs and the pins/markers are specified within the extension on this site. 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:
- width (in pixels; default is 740)
- height (in pixels; default is 600)
- lat (the center latitude on the map)
- lon (the center longitude on the map)
- zoom (the zoom level; 0 is the furthest away, 21 is the closest in)
- type ("normal" or "map", "hybrid", or "satellite"; default is "hybrid")
- 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)
- selector (show the map/hybrid/satellite selector? yes (default) and no.)
- scale (show the distance scale? yes and no (default).)
- overview (show the inset navigation map? yes and no (default).)
- icons (web address if the marker icon is customized. With "{label}" where the name of the icon will be inserted; defaults to "http://maps.google.com/mapfiles/marker{label}.png")
- icon (web address if the marker icon is not specified; the default icon is http://maps.google.com/mapfiles/marker.png)
- units ("meters" or "miles"; default is "meters".)
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:
<googlemap lat="36.500667" lon="-82.47797" zoom="12" width="500" height="400" type="map" controls="small"> </googlemap>
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.
<googlemap> http://some.url/ http://other.url/ ... </googlemap>
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.
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]]
The above commands can be used many times within a single map to create the pins needed
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:
<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
- Add the following extension icons option:
- <googlemap lat="36.500667" lon="-82.47797" icons="http://tehcc.org/clubwiki/kml/marker{label}.png">
- Prefix the pin coordinates with (X) where 'X' is the letter for the pin icon desired
- (G) 36.502891,-82.468700
Full coding of a custom icon map:
<googlemap version="0.9" lat="36.500667" lon="-82.47797" type="terrain" zoom="15" width="715" height="350" scale="yes" controls="large" 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]]
Icons reference
Icons in use at this site
Search http://code.google.com/p/google-maps-icons/ for other icons to suggest, send to webmaster for inclusion