Template:Location map: Difference between revisions
wikademia>Zocky moving the label closer to the mark |
wikademia>Patrick Creates a location map by superimposing an existing map in orthographic projection with a marker and a label. |
||
| (8 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><div style="float:{{{float|right}}};clear:{{{float|right}}};width:{{#expr:{{{width|240}}}+4}}px;padding:4px;border:solid silver 1px;margin:4px;background:white"> | <includeonly><div style="float:{{{float|right}}};clear:{{{float|right}}};width:{{#expr:{{{width|240}}}+4}}px;padding:4px;border:solid silver 1px;margin:4px;background:white"> | ||
<div style="position:relative;border:solid silver 1px;padding:0px;width:{{{width|240}}}px">[[Image:{{Location map {{{1}}}|image}}|{{{width|240}}}px]]<div style="position:absolute;z-index:200; | <div style="position:relative;border:solid silver 1px;padding:0px;width:{{{width|240}}}px">[[Image:{{Location map {{{1}}}|image}}|{{{width|240}}}px]]<br/><div style="position:absolute;z-index:200; | ||
top:{{#expr:100*({{Location map {{{1}}}|top}}-{{{lat}}}) / ({{Location map {{{1}}}|top}}-{{Location map {{{1}}}|bottom}}) round 1}}%; | top:{{#expr:100*({{Location map {{{1}}}|top}}-{{{lat}}}) / ({{Location map {{{1}}}|top}}-{{Location map {{{1}}}|bottom}}) round 1}}%; | ||
left:{{#expr:100*({{{long}}}-{{Location map {{{1}}}|left}}) / ({{Location map {{{1}}}|right}}-{{Location map {{{1}}}|left}}) round 1}}%;"> | left:{{#expr:100*({{{long}}}-{{Location map {{{1}}}|left}}) / ({{Location map {{{1}}}|right}}-{{Location map {{{1}}}|left}}) round 1}}%;height:0;width:0;margin:0;padding:0;"> | ||
<div style="position:relative;top:-4px;left:-4px;width:8px;text-align:center;z-index:201">[[image:{{{mark|ButtonRed.svg}}}|8x8px]]</div> | <div style="position:relative;top:-4px;left:-4px;width:8px;text-align:center;z-index:201">[[image:{{{mark|ButtonRed.svg}}}|8x8px]]</div> | ||
{{#switch:{{{position|right}}} | {{#switch:{{{position|right}}} | ||
|right=<div style="font-size:90%;line-height:110%;position:relative;top:- | |right=<div style="font-size:90%;line-height:110%;position:relative;top:-1.5em;left:0.5em;text-align:left;width:6em;z-index:202">{{{label}}}</div> | ||
|left=<div style="font-size:90%;line-height:110%;position:relative;top:- | |left=<div style="font-size:90%;line-height:110%;position:relative;top:-1.5em;left:-6.5em;width:6em;text-align:right;z-index:202">{{{label}}}</div> | ||
}} | }} | ||
</div> | </div> | ||
| Line 13: | Line 13: | ||
</div></includeonly> | </div></includeonly> | ||
<noinclude> | <noinclude> | ||
Creates a location map by superimposing an existing map in orthographic projection with a marker and a label. | |||
==Usage== | ==Usage== | ||
{{Location map</nowiki>|''location'' | |||
{{Location map</nowiki>|'' | |label=''label'' | ||
|label=''label'' | |position=left ''or'' right '' - position of the label relative to the mark | ||
|position=left ''or'' right '' - position of the label relative to the mark | |lat=''lattitude in degrees'' | ||
|lat=''lattitude in degrees'' | |long=''longitude in degrees'' | ||
|long=''longitude in degrees'' | |mark=''image file name - a red circle by default | ||
|mark=''image file name - a red circle by default | |caption=''caption'' - caption below the map | ||
|caption=''caption'' - caption below the map | |float=left ''or'' right ''or'' none | ||
|float=left ''or'' right ''or'' none | |width=''width of the map'' | ||
|width=''width of the map'' | }} | ||
}} | |||
==Available maps== | ==Available maps== | ||
List of templates Template:Location map ''location'' (here without prefix "Template:"), each containing the name and coordinates of a map: | |||
{{Special:Prefixindex/Template:Location_map_}} | {{Special:Prefixindex/Template:Location_map_}} | ||
==Creating new maps== | ==Creating new maps== | ||
#Find an appropriate blank map in an orthographic projection. | #Find an appropriate blank map in an orthographic projection. | ||
#Create a template named Template:Location map '' | #Create a template named Template:Location map ''location'' (copy the content of any other map template into it and enter appropriate values). | ||
==Issues== | ==Issues== | ||
Doesn't handle longitude properly for maps crossing the +/- 180 | Doesn't handle longitude properly for maps crossing the +/- 180 meridian yet. | ||
==Examples== | ==Examples== | ||
Latest revision as of 08:28, 23 May 2006
Creates a location map by superimposing an existing map in orthographic projection with a marker and a label.
Usage
{{Location map</nowiki>|location
|label=label
|position=left or right - position of the label relative to the mark
|lat=lattitude in degrees
|long=longitude in degrees
|mark=image file name - a red circle by default
|caption=caption - caption below the map
|float=left or right or none
|width=width of the map
}}
Available maps
List of templates Template:Location map location (here without prefix "Template:"), each containing the name and coordinates of a map:
Creating new maps
- Find an appropriate blank map in an orthographic projection.
- Create a template named Template:Location map location (copy the content of any other map template into it and enter appropriate values).
Issues
Doesn't handle longitude properly for maps crossing the +/- 180 meridian yet.
Examples
<div style="position:absolute;z-index:200;
top:Expression error: Unrecognized punctuation character "[".%; left:Expression error: Unrecognized punctuation character "[".%;height:0;width:0;margin:0;padding:0;">
{{Location map|Slovenia|float=none|label=Maribor|lat=46.55|long=15.64|position=left}}
<div style="position:absolute;z-index:200;
top:Expression error: Unrecognized punctuation character "[".%; left:Expression error: Unrecognized punctuation character "[".%;height:0;width:0;margin:0;padding:0;">
{{Location map|Slovenia|float=left|width=100|label=Ljubljana|lat=46.05|long=14.5|caption=Ljubljana is the capital of Slovenia}}
<div style="position:absolute;z-index:200;
top:Expression error: Unrecognized punctuation character "[".%; left:Expression error: Unrecognized punctuation character "[".%;height:0;width:0;margin:0;padding:0;">
{{Location map|Slovenia|float=right|label=Nova Gorica|lat=45.95|long=13.63}}