Difference between revisions of "Template:GMap"

From LCA2015 Delegate wiki
Jump to: navigation, search
(Created a template for displaying a link to Google Map as a hatnote.)
 
m (problems with unnamed urls)
Line 1: Line 1:
<includeonly>: <small>[[File:location-162102.png|16px|baseline|Google Maps|link={{{1}}}]] ''Google map:''  [{{{1}}} {{{2}}}]</small></includeonly><noinclude>
+
<includeonly>: <small>[[File:location-162102.png|16px|baseline|Google Maps|link={{{url}}}]] ''Google map:''  [{{{url}}} {{{title}}}]</small></includeonly><noinclude>
 
[[Category:Markup Templates]]
 
[[Category:Markup Templates]]
 
== Description ==
 
== Description ==
Line 10: Line 10:
 
! Parameter !! Scope !! Description
 
! Parameter !! Scope !! Description
 
|-
 
|-
| <code>1</code> || required || First unnamed param. The URL link to the specified Google Map.
+
| <code>url</code> || required || First unnamed param. The URL link to the specified Google Map.
 
|-
 
|-
| <code>2</code> || required || Second unnamed param. The name/title of the specified Google Map.
+
| <code>title</code> || required || Second unnamed param. The name/title of the specified Google Map.
 
|}
 
|}
  
 
== Example ==
 
== Example ==
<pre>{{GMap|https://www.google.co.nz/maps/search/dining/@-36.8528995,174.7713,15z/data=!3m1!4b1!4m4
+
<pre>{{GMap|url=https://www.google.co.nz/maps/search/dining/@-36.8528995,174.7713,15z/data=!3m1!4b1!4m4
!2m3!3m2!1sdining!2s-36.8529,+174.7713|Dining locations near the OGGB building.}}</pre>
+
!2m3!3m2!1sdining!2s-36.8529,+174.7713|title=Dining locations near the OGGB building.}}</pre>
  
 
Will display as...
 
Will display as...
{{GMap|https://www.google.co.nz/maps/search/dining/@-36.8528995,174.7713,15z/data=!3m1!4b1!4m4!2m3!3m2!1sdining!2s-36.8529,+174.7713|Dining locations near the OGGB building.}}
+
{{GMap|url=https://www.google.co.nz/maps/search/dining/@-36.8528995,174.7713,15z/data=!3m1!4b1!4m4!2m3!3m2!1sdining!2s-36.8529,+174.7713|title=Dining locations near the OGGB building.}}
  
 
</noinclude>
 
</noinclude>

Revision as of 21:57, 1 January 2015

Description

Places a hatnote with a link to a specific Google Map. Should only be used at the beginning of a new line.

Parameters

Template:GMap
Parameter Scope Description
url required First unnamed param. The URL link to the specified Google Map.
title required Second unnamed param. The name/title of the specified Google Map.

Example

{{GMap|url=https://www.google.co.nz/maps/search/dining/@-36.8528995,174.7713,15z/data=!3m1!4b1!4m4
!2m3!3m2!1sdining!2s-36.8529,+174.7713|title=Dining locations near the OGGB building.}}

Will display as...

Google Maps Google map: Dining locations near the OGGB building.