Jump to content

Module:Location map/data/China/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
update documentation and add example using Template:Location map+
update documentation, examples, see also
Line 12: Line 12:


== Map definition ==
== Map definition ==
* <tt>'''name''' = {{{{BASEPAGENAME}}|name}}</tt>
; name
: used in default map caption (<tt>{{{{BASEPAGENAME}}|name}}</tt>)
*: Name used in the default map caption

; image
: the default map image, without "Image:" or "File:" (<tt>[[:File:{{{{BASEPAGENAME}}|image}}|{{{{BASEPAGENAME}}|image}}]]</tt>)
* <tt>'''image''' = [[:File:{{{{BASEPAGENAME}}|image}}|{{{{BASEPAGENAME}}|image}}]]</tt>
*: The default map image, without "Image:" or "File:"
; image1

: an alternative map image, usually a relief map (<tt>[[:File:{{{{BASEPAGENAME}}|image1}}|{{{{BASEPAGENAME}}|image1}}]]</tt>)
* <tt>'''image1''' = [[:File:{{{{BASEPAGENAME}}|image1}}|{{{{BASEPAGENAME}}|image1}}]]</tt>
; x
*: An alternative map image, usually a relief map, can be displayed via the ''relief'' or ''AlternativeMap'' parameters
: an expression to calculate a location on the map via its [[longitude]]; evaluates as 0 along the left edge and 100 along the right edge
{{#if:{{{{BASEPAGENAME}}|image2}}|
; y

: an expression to calculate a location on the map via its [[latitude]]; evaluates as 0 along the top edge and 100 along the bottom edge
* <tt>'''image2''' = [[:File:{{{{BASEPAGENAME}}|image2}}|{{{{BASEPAGENAME}}|image2}}]]</tt>
*: A second alternative map image, can be displayed via the ''AlternativeMap'' parameter only
}}{{#if:{{{{BASEPAGENAME}}|top}}{{{{BASEPAGENAME}}|bottom}}{{{{BASEPAGENAME}}|left}}{{{{BASEPAGENAME}}|right}}|

* <tt>'''top''' = {{{{BASEPAGENAME}}|top}}</tt>
*: [[Latitude]] at top edge of map, in [[decimal degrees]]

* <tt>'''bottom''' = {{{{BASEPAGENAME}}|bottom}}</tt>
*: Latitude at bottom edge of map, in decimal degrees

* <tt>'''left''' = {{{{BASEPAGENAME}}|left}}</tt>
*: [[Longitude]] at left edge of map, in decimal degrees

* <tt>'''right''' = {{{{BASEPAGENAME}}|right}}</tt>
*: Longitude at right edge of map, in decimal degrees
}}{{#if:{{{{BASEPAGENAME}}|x}}{{{{BASEPAGENAME}}|y}}|

* <tt>'''x''' = {{{{BASEPAGENAME}}|x}}</tt>
*: An expression to calculate a location on the map via its [[longitude]]; evaluates as 0 along the left edge and 100 along the right edge

* <tt>'''y''' = {{{{BASEPAGENAME}}|y}}</tt>
*: An expression to calculate a location on the map via its [[latitude]]; evaluates as 0 along the top edge and 100 along the bottom edge
}}


== Alternative map ==
== Alternative map ==
The map shown above as '''image1''' (<tt>{{{{BASEPAGENAME}}|image1}}</tt>) can be displayed by using the ''AlternativeMap'' or ''relief'' parameters in {{tl|Location map}}, {{tl|Location map many}} and {{tl|Location map+}}. Further instructions can be found at [[Template:Location map#Using Alternative Map]] and [[Template:Location map#Relief]], or see the examples below.
The map defined as '''image1''' (<tt>{{{{BASEPAGENAME}}|image1}}</tt>) can be displayed by using the ''relief'' or ''AlternativeMap'' parameters in {{tl|Location map}}, {{tl|Location map many}} and {{tl|Location map+}}. {{#if:{{{{BASEPAGENAME}}|image2}}| The map defined as '''image2''' (<tt>{{{{BASEPAGENAME}}|image2}}</tt>) can only be displayed by using the ''AlternativeMap'' parameter.}} The use of these two parameters is shown in the examples below. Additional examples can be found at:
{|
|
* [[Template:Location map#Relief parameter]]
* [[Template:Location map#AlternativeMap parameter]]
|
* [[Template:Location map+/relief]]
* [[Template:Location map+/AlternativeMap]]
|}

== Examples using location map templates ==


== Examples ==
=== Location map, using default map (image) ===
=== Location map, using default map (image) ===
{{Location map | China
{{Location map | China
| width = 250
| width = 250
| lat = 37
| lat_deg = 37
| long = 100
| lon_deg = 100
| label = Qinghai Lake
| label = Qinghai Lake
| marksize = 6
}}
}}
<pre style="width:30em">
<pre style="width:30em">
{{Location map | China
{{Location map | China
| width = 250
| width = 250
| lat = 37
| lat_deg = 37
| long = 100
| lon_deg = 100
| label = Qinghai Lake
| label = Qinghai Lake
| marksize = 6
}}
}}
</pre>
</pre>
{{clear}}
{{clear}}


=== Location map, using relief map (image1) ===
=== Location map many, using relief map (image1) ===
{{Location map | China
| relief = yes
| width = 250
| lat = 37
| long = 100
| label = Qinghai Lake
| marksize = 6
}}
<pre style="width:30em">
{{Location map | China
| relief = yes
| width = 250
| lat = 37
| long = 100
| label = Qinghai Lake
| marksize = 6
}}
</pre>
{{clear}}

=== Location map many, using default map ===
{{Location map many | China
{{Location map many | China
| relief = yes
| caption = People's Republic of China
| width = 250
| width = 250
| lat = 39.91
| caption = People's Republic of China
| long = 116.39
| lat1_deg = 39.91
| label = Beijing
| lon1_deg = 116.39
| lat2 = 31.2
| label1 = Beijing
| long2 = 121.5
| lat2_deg = 31.2
| label2 = Shanghai
| lon2_deg = 121.5
| label2 = Shanghai
}}
}}
<pre style="width:30em">
<pre style="width:30em">
{{Location map many | China
{{Location map many | China
| relief = yes
| caption = People's Republic of China
| width = 250
| width = 250
| lat = 39.91
| caption = People's Republic of China
| long = 116.39
| lat1_deg = 39.91
| label = Beijing
| lon1_deg = 116.39
| lat2 = 31.2
| label1 = Beijing
| long2 = 121.5
| lat2_deg = 31.2
| label2 = Shanghai
| lon2_deg = 121.5
| label2 = Shanghai
}}
}}
</pre>
</pre>
Line 95: Line 106:
{{Location map+ | China
{{Location map+ | China
| AlternativeMap = China edcp relief location map.jpg
| AlternativeMap = China edcp relief location map.jpg
| caption = People's Republic of China
| width = 250
| width = 250
| caption = People's Republic of China
| places =
| places =
{{Location map~ | China
{{Location map~ | China
| lat = 39.91
| lat_deg = 39.91
| long = 116.39
| lon_deg = 116.39
| label = Beijing
| label = Beijing
}}
}}
{{Location map~ | China
{{Location map~ | China
| lat = 31.2
| lat_deg = 31.2
| long = 121.5
| lon_deg = 121.5
| label = Shanghai
| label = Shanghai
}}
}}
}}
}}
Line 112: Line 123:
{{Location map+ | China
{{Location map+ | China
| AlternativeMap = China edcp relief location map.jpg
| AlternativeMap = China edcp relief location map.jpg
| caption = People's Republic of China
| width = 250
| width = 250
| caption = People's Republic of China
| places =
| places =
{{Location map~ | China
{{Location map~ | China
| lat = 39.91
| lat_deg = 39.91
| long = 116.39
| lon_deg = 116.39
| label = Beijing
| label = Beijing
}}
}}
{{Location map~ | China
{{Location map~ | China
| lat = 31.2
| lat_deg = 31.2
| long = 121.5
| lon_deg = 121.5
| label = Shanghai
| label = Shanghai
}}
}}
}}
}}
Line 130: Line 141:


== See also ==
== See also ==
* [[Template:Location map China relief]], displays the relief map shown above (for [[Help:Infobox|infoboxes]] that do not support alternative maps)
* [[Template:Location map]]
* [[Template:Location map+]]
* [[Template:Location map China (equirectangular)]], displays a different map with different border coordinates

* [[Template:Location map many]]
* [[Template:Location map China (equirectangular)]]
; Location map templates
* [[Template:Location map China relief]]
* [[Template:Location map]], to display one mark and label using latitude and longitude
* [[Template:Location map many]], to display up to nine marks and labels
* [[Template:Location map+]], to display an unlimited number of marks and labels

; Infobox templates incorporating (passing values to) the Location map template
{{Location map/doc/See also infobox templates}}
<includeonly>
<includeonly>
<!-- Categories and interwikis go here: -->
<!-- Categories and interwikis go here: -->

Revision as of 16:52, 23 August 2011

Template:Location map China is a location map definition used to overlay markers and labels on an equidistant conic projection map of China. The markers are placed by latitude and longitude coordinates on the default map or a similar map image.

Usage

These definitions are used by the following templates when invoked with parameter "China":

Map definition

Alternative map

The map defined as image1 (Template:Location map/data/China) can be displayed by using the relief or AlternativeMap parameters in {{Location map}}, {{Location map many}} and {{Location map+}}. The map defined as image2 (Template:Location map/data/China) can only be displayed by using the AlternativeMap parameter. The use of these two parameters is shown in the examples below. Additional examples can be found at:

Examples using location map templates

Location map, using default map (image)

Qinghai Lake is located in China
Qinghai Lake
Qinghai Lake
Qinghai Lake (China)
{{Location map | China
| width   = 250
| lat_deg = 37
| lon_deg = 100
| label   = Qinghai Lake
}}

Location map many, using relief map (image1)

Location map/data/China/doc is located in China
Beijing
Beijing
Shanghai
Shanghai
People's Republic of China
{{Location map many | China
| relief   = yes
| width    = 250
| caption  = People's Republic of China
| lat1_deg = 39.91
| lon1_deg = 116.39
| label1   = Beijing
| lat2_deg = 31.2
| lon2_deg = 121.5
| label2   = Shanghai
}}

Location map+, using AlternativeMap

Location map/data/China/doc is located in China
Beijing
Beijing
Shanghai
Shanghai
People's Republic of China
{{Location map+ | China
| AlternativeMap = China edcp relief location map.jpg
| width   = 250
| caption = People's Republic of China
| places  =
  {{Location map~ | China
  | lat_deg = 39.91
  | lon_deg = 116.39
  | label   = Beijing
  }}
  {{Location map~ | China
  | lat_deg = 31.2
  | lon_deg = 121.5
  | label   = Shanghai
  }}
}}

See also

Location map templates
Infobox templates incorporating (passing values to) the Location map template
List