Difference between revisions of "Template:Location map many/sandbox2"

From blackwiki
Jump to navigation Jump to search
imported>Wikid77
(rescaled labels: left/right as x0.65 +2.5 pixels; wrapped each warning message for latitude/longitude.)
imported>Wikid77
(added markers/labels 11-15 & validation of 11-15; noinclude'd top comments)
Line 1: Line 1:
<!--
+
<noinclude><!--
 
-=====================================================================
 
-=====================================================================
 
-  Location_map_all:  Show a location map & markers in any browser
 
-  Location_map_all:  Show a location map & markers in any browser
Line 6: Line 6:
 
-- Template for image markers/labels in any browser (see bottom "NOTES")
 
-- Template for image markers/labels in any browser (see bottom "NOTES")
 
--
 
--
--  This template overlays 10 specified markers/labels on a given
+
--  This template overlays 15 specified markers/labels on a given
 
--  map (in the manner of "Template:Location_map") but also checks
 
--  map (in the manner of "Template:Location_map") but also checks
 
--  each latitude/longitude parameter against map border limits.
 
--  each latitude/longitude parameter against map border limits.
 
--
 
--
--  Warning: Code multi-nested 8 levels across 1028+ lines.
+
--  Warning: Code multi-nested 8 levels across 1606+ lines.
 
--  Warning: {{Might}}{{{appear|become}}}{{{unreadable}}}?
 
--  Warning: {{Might}}{{{appear|become}}}{{{unreadable}}}?
 
--  Warning: This template might exceed wiki-template resources.
 
--  Warning: This template might exceed wiki-template resources.
 
--  Warning: Adding spaces can kill results.
 
--  Warning: Adding spaces can kill results.
 
----------------------------------------------- Begin box division
 
----------------------------------------------- Begin box division
--><div style="width: {{#expr:
+
--></noinclude><div style="width: {{#expr:
 
   {{padleft:|3|{{{width|240}}} }} + 2 }}px; {{
 
   {{padleft:|3|{{{width|240}}} }} + 2 }}px; {{
 
   #if: {{{caption|<noinclude>x</noinclude>}}}
 
   #if: {{{caption|<noinclude>x</noinclude>}}}
Line 772: Line 772:
 
}}</div><!--end-div point#10-->
 
}}</div><!--end-div point#10-->
 
<!--10-->}}<!--endif lat10*
 
<!--10-->}}<!--endif lat10*
 +
================================================= Marker/Label #11
 +
-->{{#if: {{{lat11|{{{lat11_deg|}}} }}} |<!--
 +
  --latitude-11 exists
 +
----------------------------------------- Begin point division #11
 +
--><div style="position:absolute; z-index:2;
 +
  top: {{#expr: <!--To DEBUG, add ">" above to show calc below-->
 +
  99.2 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat11_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lat11_dir|}}}|S|-1|1}}
 +
      * ( {{{lat11_deg|0}}} + ({{{lat11_min|0}}} / 60)
 +
        + ( {{{lat11_sec|0}}} / 3600) ) }}
 +
    |<!--else, decimal form-->{{{lat11|0}}}
 +
  }}) / ( {{Location map {{{1}}}|top}}
 +
        - {{Location map {{{1}}}|bottom}} ) round 1
 +
}}%; left: {{#expr:
 +
  {{#expr:{{#if:{{Location map {{{1}}}|crosses180}}
 +
    |{{#ifeq: {{{lon11_dir|}}}|W
 +
      |-36000/({{Location map {{{1}}}|left}}-{{Location map {{{1}}}|right}})
 +
    }}|}}
 +
  }} + 99.9 * (
 +
  {{#if: {{{lon11_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lon11_dir|}}}|W|-1|1}}
 +
      * ( {{{lon11_deg|0}}} + ({{{lon11_min|0}}} / 60)
 +
        + ({{{lon11_sec|0}}} / 3600)) }}
 +
    |<!--else, decimal longitude-->{{{long11|0}}}
 +
  }} - {{Location map {{{1}}}|left}})
 +
    / ({{Location map {{{1}}}|right}} - {{Location map {{{1}}}|left}}) round 1
 +
}}%; height: 0; width: 0; margin: 0; padding: 0;"><!--
 +
------------------------------------------------ Marker#11 division
 +
--><div style="position: relative; text-align: center; <!--
 +
  --> left: -{{#expr: {{{mark11size|{{{marksize|8}}}}}} / 2 round 0 }}px; <!--
 +
  --> top: -{{#expr:{{{mark11high|{{{mark11size|{{{marksize|8}}}}}}|}}}/2 round 0}}px;<!--
 +
  --> width: {{{mark11size|{{{marksize|8}}}}}}px; <!--
 +
  --> {{{markfont| font-size: 9px; line-height:0;}}}"><!--
 +
  --------------------------- show marker#11 -->{{
 +
  #ifeq: {{{mark11size|8}}} | 0|<!--then skip-->
 +
  |<!--else-->[[Image:{{#if: {{{mark11|}}}
 +
    | {{{mark11}}}
 +
    | {{{mark|Red pog.svg}}}
 +
  }}<!--endif mark11
 +
----- set image size as 'mark11size'x'mark11high' with defaults --
 +
--    ("x" between values, defaults from marksize or 8)
 +
--> |{{{mark11size|{{{marksize|8}}}}}}x{{{mark11high|{{{mark11size|{{{marksize|8}}}|}}}|}}}px<!--
 +
--> |{{#if: {{{label11|}}}
 +
      | {{{label11}}}<!--set mouseover alt-text -
 +
  --> |<!--else-->{{PAGENAME}}
 +
    }}<!--endif label11-->]]<!--
 +
-->}}<!--endif mark11size=0
 +
--></div><!-- end-div marker 11
 +
---------------------------------------------- Label #11
 +
-->{{#ifeq: {{{position11|{{{pos11|{{{pos|}}} }}} }}} | none
 +
  |
 +
  |<div style="font-size: {{{label11_size|90}}}%; line-height: 111%;
 +
    position: relative; top: -1.5em; width: 6em;
 +
    {{#switch: {{{position11|{{{pos11|right}}}}}}
 +
      |left = top:-{{#expr: {{{mark11high|{{{mark11size|8}}}}}}*0.65
 +
              + {{{label11_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: -{{#expr: 6.05 + {{{mark11size|8}}}/21
 +
              + {{{label11_size|90}}}/1855 }}em; text-align: right;
 +
      |right = top: -{{#expr: {{{mark11high|{{{mark11size|8}}}}}}*0.65
 +
              + {{{label11_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: {{#expr: 0.37 + {{{mark11size|8}}}/165
 +
              + {{{label11_size|90}}}/505 }}em; text-align: left;
 +
      |top = top:-{{#expr: {{{mark11high|{{{mark11size|8}}}}}}*1.90
 +
                + {{{label11_size|90}}}*.13 + 19.5 round 0}}px;
 +
            left: -3em; text-align: center;
 +
      |bottom = top: -{{#expr:{{{mark11high|{{{mark11size|8}}}}}}*.45
 +
                - {{{label11_size|90}}}*.01 + 1.9 round 0}}px;
 +
            left: -3em; text-align: center;
 +
    |<!--otherwise-->}}"><span style="padding: 1px;
 +
    {{#if: {{{background11|{{{bg11|{{{bg|}}} }}} }}}
 +
      | background-color: {{{background11|{{{bg11|{{{bg}}}|}}}|}}};
 +
      }}">{{{label11|}}}</span><!--
 +
--></div><!-- end-div label11 -->
 +
}}</div><!--end-div point#11-->
 +
<!--11-->}}<!--endif lat11*
 +
================================================= Marker/Label #12
 +
-->{{#if: {{{lat12|{{{lat12_deg|}}} }}} |<!--
 +
  --latitude-12 exists
 +
----------------------------------------- Begin point division #12
 +
--><div style="position:absolute; z-index:2;
 +
  top: {{#expr: <!--To DEBUG, add ">" above to show calc below-->
 +
  99.2 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat12_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lat12_dir|}}}|S|-1|1}}
 +
      * ( {{{lat12_deg|0}}} + ({{{lat12_min|0}}} / 60)
 +
        + ( {{{lat12_sec|0}}} / 3600) ) }}
 +
    |<!--else, decimal form-->{{{lat12|0}}}
 +
  }}) / ( {{Location map {{{1}}}|top}}
 +
        - {{Location map {{{1}}}|bottom}} ) round 1
 +
}}%; left: {{#expr:
 +
  {{#expr:{{#if:{{Location map {{{1}}}|crosses180}}
 +
    |{{#ifeq: {{{lon12_dir|}}}|W
 +
      |-36000/({{Location map {{{1}}}|left}}-{{Location map {{{1}}}|right}})
 +
    }}|}}
 +
  }} + 99.9 * (
 +
  {{#if: {{{lon12_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lon12_dir|}}}|W|-1|1}}
 +
      * ( {{{lon12_deg|0}}} + ({{{lon12_min|0}}} / 60)
 +
        + ({{{lon12_sec|0}}} / 3600)) }}
 +
    |<!--else, decimal longitude-->{{{long12|0}}}
 +
  }} - {{Location map {{{1}}}|left}})
 +
    / ({{Location map {{{1}}}|right}} - {{Location map {{{1}}}|left}}) round 1
 +
}}%; height: 0; width: 0; margin: 0; padding: 0;"><!--
 +
------------------------------------------------ Marker#12 division
 +
--><div style="position: relative; text-align: center; <!--
 +
  --> left: -{{#expr: {{{mark12size|{{{marksize|8}}}}}} / 2 round 0 }}px; <!--
 +
  --> top: -{{#expr:{{{mark12high|{{{mark12size|{{{marksize|8}}}}}}|}}}/2 round 0}}px;<!--
 +
  --> width: {{{mark12size|{{{marksize|8}}}}}}px; <!--
 +
  --> {{{markfont| font-size: 9px; line-height:0;}}}"><!--
 +
  --------------------------- show marker#12 -->{{
 +
  #ifeq: {{{mark12size|8}}} | 0|<!--then skip-->
 +
  |<!--else-->[[Image:{{#if: {{{mark12|}}}
 +
    | {{{mark12}}}
 +
    | {{{mark|Red pog.svg}}}
 +
  }}<!--endif mark12
 +
----- set image size as 'mark12size'x'mark12high' with defaults --
 +
--    ("x" between values, defaults from marksize or 8)
 +
--> |{{{mark12size|{{{marksize|8}}}}}}x{{{mark12high|{{{mark12size|{{{marksize|8}}}|}}}|}}}px<!--
 +
--> |{{#if: {{{label12|}}}
 +
      | {{{label12}}}<!--set mouseover alt-text -
 +
  --> |<!--else-->{{PAGENAME}}
 +
    }}<!--endif label12-->]]<!--
 +
-->}}<!--endif mark12size=0
 +
--></div><!-- end-div marker 12
 +
---------------------------------------------- Label #12
 +
-->{{#ifeq: {{{position12|{{{pos12|{{{pos|}}} }}} }}} | none
 +
  |
 +
  |<div style="font-size: {{{label12_size|90}}}%; line-height: 112%;
 +
    position: relative; top: -1.5em; width: 6em;
 +
    {{#switch: {{{position12|{{{pos12|right}}}}}}
 +
      |left = top:-{{#expr: {{{mark12high|{{{mark12size|8}}}}}}*0.65
 +
              + {{{label12_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: -{{#expr: 6.05 + {{{mark12size|8}}}/21
 +
              + {{{label12_size|90}}}/1855 }}em; text-align: right;
 +
      |right = top: -{{#expr: {{{mark12high|{{{mark12size|8}}}}}}*0.65
 +
              + {{{label12_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: {{#expr: 0.37 + {{{mark12size|8}}}/165
 +
              + {{{label12_size|90}}}/505 }}em; text-align: left;
 +
      |top = top:-{{#expr: {{{mark12high|{{{mark12size|8}}}}}}*1.90
 +
                + {{{label12_size|90}}}*.13 + 19.5 round 0}}px;
 +
            left: -3em; text-align: center;
 +
      |bottom = top: -{{#expr:{{{mark12high|{{{mark12size|8}}}}}}*.45
 +
                - {{{label12_size|90}}}*.01 + 1.9 round 0}}px;
 +
            left: -3em; text-align: center;
 +
    |<!--otherwise-->}}"><span style="padding: 1px;
 +
    {{#if: {{{background12|{{{bg12|{{{bg|}}} }}} }}}
 +
      | background-color: {{{background12|{{{bg12|{{{bg}}}|}}}|}}};
 +
      }}">{{{label12|}}}</span><!--
 +
--></div><!-- end-div label12 -->
 +
}}</div><!--end-div point#12-->
 +
<!--12-->}}<!--endif lat12*
 +
================================================= Marker/Label #13
 +
-->{{#if: {{{lat13|{{{lat13_deg|}}} }}} |<!--
 +
  --latitude-13 exists
 +
----------------------------------------- Begin point division #13
 +
--><div style="position:absolute; z-index:2;
 +
  top: {{#expr: <!--To DEBUG, add ">" above to show calc below-->
 +
  99.2 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat13_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lat13_dir|}}}|S|-1|1}}
 +
      * ( {{{lat13_deg|0}}} + ({{{lat13_min|0}}} / 60)
 +
        + ( {{{lat13_sec|0}}} / 3600) ) }}
 +
    |<!--else, decimal form-->{{{lat13|0}}}
 +
  }}) / ( {{Location map {{{1}}}|top}}
 +
        - {{Location map {{{1}}}|bottom}} ) round 1
 +
}}%; left: {{#expr:
 +
  {{#expr:{{#if:{{Location map {{{1}}}|crosses180}}
 +
    |{{#ifeq: {{{lon13_dir|}}}|W
 +
      |-36000/({{Location map {{{1}}}|left}}-{{Location map {{{1}}}|right}})
 +
    }}|}}
 +
  }} + 99.9 * (
 +
  {{#if: {{{lon13_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lon13_dir|}}}|W|-1|1}}
 +
      * ( {{{lon13_deg|0}}} + ({{{lon13_min|0}}} / 60)
 +
        + ({{{lon13_sec|0}}} / 3600)) }}
 +
    |<!--else, decimal longitude-->{{{long13|0}}}
 +
  }} - {{Location map {{{1}}}|left}})
 +
    / ({{Location map {{{1}}}|right}} - {{Location map {{{1}}}|left}}) round 1
 +
}}%; height: 0; width: 0; margin: 0; padding: 0;"><!--
 +
------------------------------------------------ Marker#13 division
 +
--><div style="position: relative; text-align: center; <!--
 +
  --> left: -{{#expr: {{{mark13size|{{{marksize|8}}}}}} / 2 round 0 }}px; <!--
 +
  --> top: -{{#expr:{{{mark13high|{{{mark13size|{{{marksize|8}}}}}}|}}}/2 round 0}}px;<!--
 +
  --> width: {{{mark13size|{{{marksize|8}}}}}}px; <!--
 +
  --> {{{markfont| font-size: 9px; line-height:0;}}}"><!--
 +
  --------------------------- show marker#13 -->{{
 +
  #ifeq: {{{mark13size|8}}} | 0|<!--then skip-->
 +
  |<!--else-->[[Image:{{#if: {{{mark13|}}}
 +
    | {{{mark13}}}
 +
    | {{{mark|Red pog.svg}}}
 +
  }}<!--endif mark13
 +
----- set image size as 'mark13size'x'mark13high' with defaults --
 +
--    ("x" between values, defaults from marksize or 8)
 +
--> |{{{mark13size|{{{marksize|8}}}}}}x{{{mark13high|{{{mark13size|{{{marksize|8}}}|}}}|}}}px<!--
 +
--> |{{#if: {{{label13|}}}
 +
      | {{{label13}}}<!--set mouseover alt-text -
 +
  --> |<!--else-->{{PAGENAME}}
 +
    }}<!--endif label13-->]]<!--
 +
-->}}<!--endif mark13size=0
 +
--></div><!-- end-div marker 13
 +
---------------------------------------------- Label #13
 +
-->{{#ifeq: {{{position13|{{{pos13|{{{pos|}}} }}} }}} | none
 +
  |
 +
  |<div style="font-size: {{{label13_size|90}}}%; line-height: 113%;
 +
    position: relative; top: -1.5em; width: 6em;
 +
    {{#switch: {{{position13|{{{pos13|right}}}}}}
 +
      |left = top:-{{#expr: {{{mark13high|{{{mark13size|8}}}}}}*0.65
 +
              + {{{label13_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: -{{#expr: 6.05 + {{{mark13size|8}}}/21
 +
              + {{{label13_size|90}}}/1855 }}em; text-align: right;
 +
      |right = top: -{{#expr: {{{mark13high|{{{mark13size|8}}}}}}*0.65
 +
              + {{{label13_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: {{#expr: 0.37 + {{{mark13size|8}}}/165
 +
              + {{{label13_size|90}}}/505 }}em; text-align: left;
 +
      |top = top:-{{#expr: {{{mark13high|{{{mark13size|8}}}}}}*1.90
 +
                + {{{label13_size|90}}}*.13 + 19.5 round 0}}px;
 +
            left: -3em; text-align: center;
 +
      |bottom = top: -{{#expr:{{{mark13high|{{{mark13size|8}}}}}}*.45
 +
                - {{{label13_size|90}}}*.01 + 1.9 round 0}}px;
 +
            left: -3em; text-align: center;
 +
    |<!--otherwise-->}}"><span style="padding: 1px;
 +
    {{#if: {{{background13|{{{bg13|{{{bg|}}} }}} }}}
 +
      | background-color: {{{background13|{{{bg13|{{{bg}}}|}}}|}}};
 +
      }}">{{{label13|}}}</span><!--
 +
--></div><!-- end-div label13 -->
 +
}}</div><!--end-div point#13-->
 +
<!--13-->}}<!--endif lat13*
 +
================================================= Marker/Label #14
 +
-->{{#if: {{{lat14|{{{lat14_deg|}}} }}} |<!--
 +
  --latitude-14 exists
 +
----------------------------------------- Begin point division #14
 +
--><div style="position:absolute; z-index:2;
 +
  top: {{#expr: <!--To DEBUG, add ">" above to show calc below-->
 +
  99.2 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat14_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lat14_dir|}}}|S|-1|1}}
 +
      * ( {{{lat14_deg|0}}} + ({{{lat14_min|0}}} / 60)
 +
        + ( {{{lat14_sec|0}}} / 3600) ) }}
 +
    |<!--else, decimal form-->{{{lat14|0}}}
 +
  }}) / ( {{Location map {{{1}}}|top}}
 +
        - {{Location map {{{1}}}|bottom}} ) round 1
 +
}}%; left: {{#expr:
 +
  {{#expr:{{#if:{{Location map {{{1}}}|crosses180}}
 +
    |{{#ifeq: {{{lon14_dir|}}}|W
 +
      |-36000/({{Location map {{{1}}}|left}}-{{Location map {{{1}}}|right}})
 +
    }}|}}
 +
  }} + 99.9 * (
 +
  {{#if: {{{lon14_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lon14_dir|}}}|W|-1|1}}
 +
      * ( {{{lon14_deg|0}}} + ({{{lon14_min|0}}} / 60)
 +
        + ({{{lon14_sec|0}}} / 3600)) }}
 +
    |<!--else, decimal longitude-->{{{long14|0}}}
 +
  }} - {{Location map {{{1}}}|left}})
 +
    / ({{Location map {{{1}}}|right}} - {{Location map {{{1}}}|left}}) round 1
 +
}}%; height: 0; width: 0; margin: 0; padding: 0;"><!--
 +
------------------------------------------------ Marker#14 division
 +
--><div style="position: relative; text-align: center; <!--
 +
  --> left: -{{#expr: {{{mark14size|{{{marksize|8}}}}}} / 2 round 0 }}px; <!--
 +
  --> top: -{{#expr:{{{mark14high|{{{mark14size|{{{marksize|8}}}}}}|}}}/2 round 0}}px;<!--
 +
  --> width: {{{mark14size|{{{marksize|8}}}}}}px; <!--
 +
  --> {{{markfont| font-size: 9px; line-height:0;}}}"><!--
 +
  --------------------------- show marker#14 -->{{
 +
  #ifeq: {{{mark14size|8}}} | 0|<!--then skip-->
 +
  |<!--else-->[[Image:{{#if: {{{mark14|}}}
 +
    | {{{mark14}}}
 +
    | {{{mark|Red pog.svg}}}
 +
  }}<!--endif mark14
 +
----- set image size as 'mark14size'x'mark14high' with defaults --
 +
--    ("x" between values, defaults from marksize or 8)
 +
--> |{{{mark14size|{{{marksize|8}}}}}}x{{{mark14high|{{{mark14size|{{{marksize|8}}}|}}}|}}}px<!--
 +
--> |{{#if: {{{label14|}}}
 +
      | {{{label14}}}<!--set mouseover alt-text -
 +
  --> |<!--else-->{{PAGENAME}}
 +
    }}<!--endif label14-->]]<!--
 +
-->}}<!--endif mark14size=0
 +
--></div><!-- end-div marker 14
 +
---------------------------------------------- Label #14
 +
-->{{#ifeq: {{{position14|{{{pos14|{{{pos|}}} }}} }}} | none
 +
  |
 +
  |<div style="font-size: {{{label14_size|90}}}%; line-height: 114%;
 +
    position: relative; top: -1.5em; width: 6em;
 +
    {{#switch: {{{position14|{{{pos14|right}}}}}}
 +
      |left = top:-{{#expr: {{{mark14high|{{{mark14size|8}}}}}}*0.65
 +
              + {{{label14_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: -{{#expr: 6.05 + {{{mark14size|8}}}/21
 +
              + {{{label14_size|90}}}/1855 }}em; text-align: right;
 +
      |right = top: -{{#expr: {{{mark14high|{{{mark14size|8}}}}}}*0.65
 +
              + {{{label14_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: {{#expr: 0.37 + {{{mark14size|8}}}/165
 +
              + {{{label14_size|90}}}/505 }}em; text-align: left;
 +
      |top = top:-{{#expr: {{{mark14high|{{{mark14size|8}}}}}}*1.90
 +
                + {{{label14_size|90}}}*.13 + 19.5 round 0}}px;
 +
            left: -3em; text-align: center;
 +
      |bottom = top: -{{#expr:{{{mark14high|{{{mark14size|8}}}}}}*.45
 +
                - {{{label14_size|90}}}*.01 + 1.9 round 0}}px;
 +
            left: -3em; text-align: center;
 +
    |<!--otherwise-->}}"><span style="padding: 1px;
 +
    {{#if: {{{background14|{{{bg14|{{{bg|}}} }}} }}}
 +
      | background-color: {{{background14|{{{bg14|{{{bg}}}|}}}|}}};
 +
      }}">{{{label14|}}}</span><!--
 +
--></div><!-- end-div label14 -->
 +
}}</div><!--end-div point#14-->
 +
<!--14-->}}<!--endif lat14*
 +
================================================= Marker/Label #15
 +
-->{{#if: {{{lat15|{{{lat15_deg|}}} }}} |<!--
 +
  --latitude-15 exists
 +
----------------------------------------- Begin point division #15
 +
--><div style="position:absolute; z-index:2;
 +
  top: {{#expr: <!--To DEBUG, add ">" above to show calc below-->
 +
  99.2 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat15_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lat15_dir|}}}|S|-1|1}}
 +
      * ( {{{lat15_deg|0}}} + ({{{lat15_min|0}}} / 60)
 +
        + ( {{{lat15_sec|0}}} / 3600) ) }}
 +
    |<!--else, decimal form-->{{{lat15|0}}}
 +
  }}) / ( {{Location map {{{1}}}|top}}
 +
        - {{Location map {{{1}}}|bottom}} ) round 1
 +
}}%; left: {{#expr:
 +
  {{#expr:{{#if:{{Location map {{{1}}}|crosses180}}
 +
    |{{#ifeq: {{{lon15_dir|}}}|W
 +
      |-36000/({{Location map {{{1}}}|left}}-{{Location map {{{1}}}|right}})
 +
    }}|}}
 +
  }} + 99.9 * (
 +
  {{#if: {{{lon15_deg|}}}
 +
    | {{#expr: {{#ifeq: {{{lon15_dir|}}}|W|-1|1}}
 +
      * ( {{{lon15_deg|0}}} + ({{{lon15_min|0}}} / 60)
 +
        + ({{{lon15_sec|0}}} / 3600)) }}
 +
    |<!--else, decimal longitude-->{{{long15|0}}}
 +
  }} - {{Location map {{{1}}}|left}})
 +
    / ({{Location map {{{1}}}|right}} - {{Location map {{{1}}}|left}}) round 1
 +
}}%; height: 0; width: 0; margin: 0; padding: 0;"><!--
 +
------------------------------------------------ Marker#15 division
 +
--><div style="position: relative; text-align: center; <!--
 +
  --> left: -{{#expr: {{{mark15size|{{{marksize|8}}}}}} / 2 round 0 }}px; <!--
 +
  --> top: -{{#expr:{{{mark15high|{{{mark15size|{{{marksize|8}}}}}}|}}}/2 round 0}}px;<!--
 +
  --> width: {{{mark15size|{{{marksize|8}}}}}}px; <!--
 +
  --> {{{markfont| font-size: 9px; line-height:0;}}}"><!--
 +
  --------------------------- show marker#15 -->{{
 +
  #ifeq: {{{mark15size|8}}} | 0|<!--then skip-->
 +
  |<!--else-->[[Image:{{#if: {{{mark15|}}}
 +
    | {{{mark15}}}
 +
    | {{{mark|Red pog.svg}}}
 +
  }}<!--endif mark15
 +
----- set image size as 'mark15size'x'mark15high' with defaults --
 +
--    ("x" between values, defaults from marksize or 8)
 +
--> |{{{mark15size|{{{marksize|8}}}}}}x{{{mark15high|{{{mark15size|{{{marksize|8}}}|}}}|}}}px<!--
 +
--> |{{#if: {{{label15|}}}
 +
      | {{{label15}}}<!--set mouseover alt-text -
 +
  --> |<!--else-->{{PAGENAME}}
 +
    }}<!--endif label15-->]]<!--
 +
-->}}<!--endif mark15size=0
 +
--></div><!-- end-div marker 15
 +
---------------------------------------------- Label #15
 +
-->{{#ifeq: {{{position15|{{{pos15|{{{pos|}}} }}} }}} | none
 +
  |
 +
  |<div style="font-size: {{{label15_size|90}}}%; line-height: 115%;
 +
    position: relative; top: -1.5em; width: 6em;
 +
    {{#switch: {{{position15|{{{pos15|right}}}}}}
 +
      |left = top:-{{#expr: {{{mark15high|{{{mark15size|8}}}}}}*0.65
 +
              + {{{label15_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: -{{#expr: 6.05 + {{{mark15size|8}}}/21
 +
              + {{{label15_size|90}}}/1855 }}em; text-align: right;
 +
      |right = top: -{{#expr: {{{mark15high|{{{mark15size|8}}}}}}*0.65
 +
              + {{{label15_size|90}}}*.15 + 2.5 round 0}}px;
 +
            left: {{#expr: 0.37 + {{{mark15size|8}}}/165
 +
              + {{{label15_size|90}}}/505 }}em; text-align: left;
 +
      |top = top:-{{#expr: {{{mark15high|{{{mark15size|8}}}}}}*1.90
 +
                + {{{label15_size|90}}}*.13 + 19.5 round 0}}px;
 +
            left: -3em; text-align: center;
 +
      |bottom = top: -{{#expr:{{{mark15high|{{{mark15size|8}}}}}}*.45
 +
                - {{{label15_size|90}}}*.01 + 1.9 round 0}}px;
 +
            left: -3em; text-align: center;
 +
    |<!--otherwise-->}}"><span style="padding: 1px;
 +
    {{#if: {{{background15|{{{bg15|{{{bg|}}} }}} }}}
 +
      | background-color: {{{background15|{{{bg15|{{{bg}}}|}}}|}}};
 +
      }}">{{{label15|}}}</span><!--
 +
--></div><!-- end-div label15 -->
 +
}}</div><!--end-div point#15-->
 +
<!--15-->}}<!--endif lat15*
 
================================================ End All Markers
 
================================================ End All Markers
 
--></div><div style="font-size: 90%">{{{caption|{{#if: {{{label|}}}  
 
--></div><div style="font-size: 90%">{{{caption|{{#if: {{{label|}}}  
Line 983: Line 1,358:
 
       --> max ({{#expr:{{Location map {{{1}}}|right}} round 2}}).
 
       --> max ({{#expr:{{Location map {{{1}}}|right}} round 2}}).
 
}}<!--10-->}}<!--endif lat10*
 
}}<!--10-->}}<!--endif lat10*
============================================ End Verification
+
------------------------------------------------- Marker/Label #11
 +
-->{{#if: {{{lat11|{{{lat11_deg|}}} }}} |<!--
 +
  --latitude-11 exists -- verify lat./longitude
 +
-->{{
 +
#ifexpr: {{{lat11| {{{lat11_deg}}}
 +
    + {{{lat11_min|0}}}/60|}}} < {{Location map {{{1}}}|bottom}}
 +
  |<!--then--><br>Latitude#11 ({{{lat11|{{{lat11_deg|}}}}}}) < map<!--
 +
  --> min ({{#expr:{{Location map {{{1}}}|bottom}} round 2}}).
 +
}}{{#ifexpr: {{{lat11|{{{lat11_deg|}}}}}} > {{Location map {{{1}}}|top}}
 +
  |<!--then--><br>Latitude#11 ({{{lat11|{{{lat11_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|top}} round 2}}).
 +
}}{{#ifexpr: {{{long11| {{{lon11_deg}}}
 +
    + {{{lon11_min|0}}}/60|}}} < {{Location map {{{1}}}|left}}
 +
  |<!--then--><br>Longitude#11 ({{{long11|{{{lon11_deg|}}}}}}) < map<!--
 +
      --> min ({{#expr:{{Location map {{{1}}}|left}} round 2}}).
 +
}}{{#ifexpr: {{{long11|{{{lon11_deg|}}}}}}
 +
                > {{Location map {{{1}}}|right}}
 +
  |<!--then--><br>Longitude#11 ({{{long11|{{{lon11_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|right}} round 2}}).
 +
}}<!--11-->}}<!--endif lat11*
 +
------------------------------------------------- Marker/Label #12
 +
-->{{#if: {{{lat12|{{{lat12_deg|}}} }}} |<!--
 +
  --latitude-12 exists -- verify lat./longitude
 +
-->{{
 +
#ifexpr: {{{lat12| {{{lat12_deg}}}
 +
    + {{{lat12_min|0}}}/60|}}} < {{Location map {{{1}}}|bottom}}
 +
  |<!--then--><br>Latitude#12 ({{{lat12|{{{lat12_deg|}}}}}}) < map<!--
 +
  --> min ({{#expr:{{Location map {{{1}}}|bottom}} round 2}}).
 +
}}{{#ifexpr: {{{lat12|{{{lat12_deg|}}}}}} > {{Location map {{{1}}}|top}}
 +
  |<!--then--><br>Latitude#12 ({{{lat12|{{{lat12_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|top}} round 2}}).
 +
}}{{#ifexpr: {{{long12| {{{lon12_deg}}}
 +
    + {{{lon12_min|0}}}/60|}}} < {{Location map {{{1}}}|left}}
 +
  |<!--then--><br>Longitude#12 ({{{long12|{{{lon12_deg|}}}}}}) < map<!--
 +
      --> min ({{#expr:{{Location map {{{1}}}|left}} round 2}}).
 +
}}{{#ifexpr: {{{long12|{{{lon12_deg|}}}}}}
 +
                > {{Location map {{{1}}}|right}}
 +
  |<!--then--><br>Longitude#12 ({{{long12|{{{lon12_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|right}} round 2}}).
 +
}}<!--12-->}}<!--endif lat12*
 +
------------------------------------------------- Marker/Label #13
 +
-->{{#if: {{{lat13|{{{lat13_deg|}}} }}} |<!--
 +
  --latitude-13 exists -- verify lat./longitude
 +
-->{{
 +
#ifexpr: {{{lat13| {{{lat13_deg}}}
 +
    + {{{lat13_min|0}}}/60|}}} < {{Location map {{{1}}}|bottom}}
 +
  |<!--then--><br>Latitude#13 ({{{lat13|{{{lat13_deg|}}}}}}) < map<!--
 +
  --> min ({{#expr:{{Location map {{{1}}}|bottom}} round 2}}).
 +
}}{{#ifexpr: {{{lat13|{{{lat13_deg|}}}}}} > {{Location map {{{1}}}|top}}
 +
  |<!--then--><br>Latitude#13 ({{{lat13|{{{lat13_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|top}} round 2}}).
 +
}}{{#ifexpr: {{{long13| {{{lon13_deg}}}
 +
    + {{{lon13_min|0}}}/60|}}} < {{Location map {{{1}}}|left}}
 +
  |<!--then--><br>Longitude#13 ({{{long13|{{{lon13_deg|}}}}}}) < map<!--
 +
      --> min ({{#expr:{{Location map {{{1}}}|left}} round 2}}).
 +
}}{{#ifexpr: {{{long13|{{{lon13_deg|}}}}}}
 +
                > {{Location map {{{1}}}|right}}
 +
  |<!--then--><br>Longitude#13 ({{{long13|{{{lon13_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|right}} round 2}}).
 +
}}<!--13-->}}<!--endif lat13*
 +
------------------------------------------------- Marker/Label #14
 +
-->{{#if: {{{lat14|{{{lat14_deg|}}} }}} |<!--
 +
  --latitude-14 exists -- verify lat./longitude
 +
-->{{
 +
#ifexpr: {{{lat14| {{{lat14_deg}}}
 +
    + {{{lat14_min|0}}}/60|}}} < {{Location map {{{1}}}|bottom}}
 +
  |<!--then--><br>Latitude#14 ({{{lat14|{{{lat14_deg|}}}}}}) < map<!--
 +
  --> min ({{#expr:{{Location map {{{1}}}|bottom}} round 2}}).
 +
}}{{#ifexpr: {{{lat14|{{{lat14_deg|}}}}}} > {{Location map {{{1}}}|top}}
 +
  |<!--then--><br>Latitude#14 ({{{lat14|{{{lat14_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|top}} round 2}}).
 +
}}{{#ifexpr: {{{long14| {{{lon14_deg}}}
 +
    + {{{lon14_min|0}}}/60|}}} < {{Location map {{{1}}}|left}}
 +
  |<!--then--><br>Longitude#14 ({{{long14|{{{lon14_deg|}}}}}}) < map<!--
 +
      --> min ({{#expr:{{Location map {{{1}}}|left}} round 2}}).
 +
}}{{#ifexpr: {{{long14|{{{lon14_deg|}}}}}}
 +
                > {{Location map {{{1}}}|right}}
 +
  |<!--then--><br>Longitude#14 ({{{long14|{{{lon14_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|right}} round 2}}).
 +
}}<!--14-->}}<!--endif lat14*
 +
------------------------------------------------- Marker/Label #15
 +
-->{{#if: {{{lat15|{{{lat15_deg|}}} }}} |<!--
 +
  --latitude-15 exists -- verify lat./longitude
 +
-->{{
 +
#ifexpr: {{{lat15| {{{lat15_deg}}}
 +
    + {{{lat15_min|0}}}/60|}}} < {{Location map {{{1}}}|bottom}}
 +
  |<!--then--><br>Latitude#15 ({{{lat15|{{{lat15_deg|}}}}}}) < map<!--
 +
  --> min ({{#expr:{{Location map {{{1}}}|bottom}} round 2}}).
 +
}}{{#ifexpr: {{{lat15|{{{lat15_deg|}}}}}} > {{Location map {{{1}}}|top}}
 +
  |<!--then--><br>Latitude#15 ({{{lat15|{{{lat15_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|top}} round 2}}).
 +
}}{{#ifexpr: {{{long15| {{{lon15_deg}}}
 +
    + {{{lon15_min|0}}}/60|}}} < {{Location map {{{1}}}|left}}
 +
  |<!--then--><br>Longitude#15 ({{{long15|{{{lon15_deg|}}}}}}) < map<!--
 +
      --> min ({{#expr:{{Location map {{{1}}}|left}} round 2}}).
 +
}}{{#ifexpr: {{{long15|{{{lon15_deg|}}}}}}
 +
                > {{Location map {{{1}}}|right}}
 +
  |<!--then--><br>Longitude#15 ({{{long15|{{{lon15_deg|}}}}}}) > map<!--
 +
      --> max ({{#expr:{{Location map {{{1}}}|right}} round 2}}).
 +
}}<!--15-->}}<!--endif lat15*
 +
============================================ End Validation
 
-->}}<noinclude><!--endif {verify}=yes
 
-->}}<noinclude><!--endif {verify}=yes
 
--
 
--
Line 1,008: Line 1,483:
 
--      to exceed the map image when 100% by 2px, or (height+2)/height.
 
--      to exceed the map image when 100% by 2px, or (height+2)/height.
 
--      The slight 2-pixel error was only significant for markers near
 
--      The slight 2-pixel error was only significant for markers near
--      bottom/right edges, so the bug persisted for years.
+
--      bottom/right edges, so the bug had persisted for years.
 
--
 
--
 
-- NOTE H2: The div-tag attribute "line-height:0" has been set to zero
 
-- NOTE H2: The div-tag attribute "line-height:0" has been set to zero
Line 1,018: Line 1,493:
 
--      a marker in the exact div location, but not for other browsers.
 
--      a marker in the exact div location, but not for other browsers.
 
--
 
--
 +
-------------------------------------------------------------------------
 
--HISTORY:
 
--HISTORY:
 
-- 06Sep07 Created/debugged to allow 3 markers.
 
-- 06Sep07 Created/debugged to allow 3 markers.
Line 1,045: Line 1,521:
 
-- 30Nov12 Scaled markers 1-10 y: 99.2%, x: 99.9% for 2-pixel border.
 
-- 30Nov12 Scaled markers 1-10 y: 99.2%, x: 99.9% for 2-pixel border.
 
-- 30Nov12 Wrapped each warning message for latitude/longitude.
 
-- 30Nov12 Wrapped each warning message for latitude/longitude.
 +
-- 29Dec12 Added markers/labels 11-15 & validation of 11-15.
 
-->
 
-->
 
{{clear}}{{Documentation}}
 
{{clear}}{{Documentation}}

Revision as of 11:38, 29 December 2012

[[image:Template:Location map World|240px|Location map many/sandbox2 ({{Location map {{{1}}}|name}})]]
Location map many/sandbox2 ({{Location map {{{1}}}|name}})

The Template:Location map many/sandbox2 creates a location map as a composite image of an existing map, with multiple (up to 22) markers and optional labels superimposed onto it. This template functions in the style of Template:Location_map, but allows 22 markers and labels (rather than just one marker). The positions of the markers will display correctly on all browsers, even on older MSIE browsers.

For an unlimited list of markers/labels, see: Template:Location map+, which specifies points as a coded template list of markers/labels.

Usage

The first unnamed parameter (shown as {{{1}}} below) specifies a map definition template. If {{{1}}} is Spain, the map image and coordinates are based on the values defined in Template:Location map Spain.

{{Location map many/sandbox2
| {{{1}}}
| width       = 
| float       = 
| border      = 
| caption     = 
| alt         = 
| relief      = 
| AlternativeMap = 
| <!--first label/marker-->
| label       = 
| label_size  = 
| position    =  <!-- or: pos -->
| background  =  <!-- or: bg -->
| mark        = 
| marksize    = 
| link1       =  <!-- or: link -->
| lat_deg     = 
| lat_min     = 
| lat_sec     = 
| lat_dir     = 
| lon_deg     = 
| lon_min     = 
| lon_sec     = 
| lon_dir     = 
| <!--second label/marker-->
| label2      = 
| label2_size = 
| position2   =  <!-- or: pos2 -->
| background2 =  <!-- or: bg2 -->
| mark2       = 
| mark2size   = 
| link2       = 
| lat2_deg    = 
| lat2_min    = 
| lat2_sec    = 
| lat2_dir    = 
| lon2_deg    = 
| lon2_min    = 
| lon2_sec    = 
| lon2_dir    = 
| <!--repeat as needed up to label22-->
}}

Parameters

Map display parameters
Parameter Description
{{{1}}} Required. Use the name of the map as the first unnamed parameter. For example, specify England to use the values in {{Location map England}}. See the examples below.
width Determines the width of the map in pixels. The default is 240. Do not include px, for example: width=300, not width=300px.
float Specifies the position of the map on the page. Valid values are left, right, center and none. The default is right.
border Specifies the color of the 1px map border. The default is lightgrey (see web colors). If set to none, no border will be generated. This parameter is seldom used.
caption The text of a caption to be displayed below the map. Specifying a caption will cause the map to be displayed with a frame. If caption is defined but is not assigned a value, the map will not be framed and no caption will be displayed. If caption is not defined, the map will not be framed and a default caption will be generated. The default caption is created from the label parameter (or the current page name if label not defined) and the name parameter from map definition template. See the examples below.
alt Alt text for map; used by screen readers, see WP:ALT.
AlternativeMap or image=xx.jpg Allows the use of an alternative map or any image. The image must have the same edge coordinates as the location map template. See the example at Location map+/AlternativeMap.
Label and mark parameters
Parameter Description
label
label10
The text of the label to display next to the mark. A wiki link can be used. The default if not specified is no label, just the marker.
label_size
label10_size
The font size to use for the label, given as a percentage of the normal font size (<100 = smaller, >100 = larger). The default is 90. Do not include %, for example: label_size=80, not label_size=80%.
position or pos
pos10
The position of the label relative to the mark. Valid values are left, right, top and bottom. The default is right.
background or bg
bg10
The background color to use for the label. See Web colors. The default is no background color, which shows the map image behind the label.
mark
mark10
The name of an image to display as the mark. The default is Red pog.svg (8px). See examples at Commons:Location markers and Commons:Category:Map icons.
marksize
mark10size
The size of the mark in pixels. The default is 8. Do not include px, for example: marksize=10, not marksize=10px.
markhigh
mark10high
The height of the mark in pixels. The default is 8. Do not include px, for example: markhigh=10, not markhigh=10px.
link1
link10
Specifies a wiki link which will be followed if the reader clicks on the mark. The name of the linked article is displayed when the mouse pointer hovers over the mark.
lat_deg
lat10_deg
Required. The degrees of latitude. This value can be specified using decimal degrees and when this format is used minutes and seconds should not be specified.
lat_min
lat10_min
The minutes of latitude.
lat_sec
lat10_sec
The seconds of latitude. Usually not necessary.
lat_dir
lat10_dir
N if north (default value) or S for south of the Equator. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for southern latitude).
lon_deg
lon10_deg
Required. The degrees of longitude. This value can be specified using decimal degrees and when this format is used minutes and seconds should not be specified.
lon_min
lon10_min
The minutes of longitude.
lon_sec
lon10_sec
The seconds of longitude. Usually not necessary.
lon_dir
lon10_dir
E for east (default value) or W for west of the Prime Meridian. Other values will be disregarded. Not required if using signed decimal degrees (i.e. negative numbers for western longitude).

Note: For brevity, parameters "pos" & "bg" are aliases (for "position" & "background"), with pos2, bg2, pos3, bg3, etc.

Markers

When a marker's mark#size=0, then that marker is skipped and only the related label is displayed, without the marker.

Each mark, mark2, mark3 (etc.) can be another image-symbol, such as Diamond_sheer_red_20.gif (marksize=20) to show a red diamond on the image: 20px or use: Cercle_rouge_100%.svg to show a red circle 20px or a larger black diamond: Diamond_sheer_black_37.gif as sized with a larger marksize=37 or similar number to resize the diamond somewhat: 37px

See Wikimedia pointer symbols: commons:Category:Map pointers.

Advisory messages

The degrees of latitude/longitude are validated, to show error messages, but location minutes can be set very large to place markers outside the map (with no warnings). Due to the numerous details of specifying 9 markers/labels, the latitude and longitude are checked to lie within the actual map limits specified in Template:Location_map_<parameter1>. Each marker/label is checked and can list a warning message (under the map), such as:

Latitude#4 (45.68) < map min(53.74).

Processing continues, with that marker actually placed off-map, and all latitude/longitude parameters are checked, for a total of 18 possible advisory messages. Only degrees of latitude/longitude are checked, so a value of 63 minutes would be valid to indicate 1 extra degree + 3 minutes, and setting lon_min=200 could still place a marker off-map (right-side) with no warning message. Also, large markers or long labels can spill over the edges of a map, allowing markers to point inward from outside the map. In such cases, a map could be centered by itself on the page ("float=center") to avoid overlapping the edge markers onto any surrounding article text.

Available maps

Partial list of live templates named Template:Location_map_<locname> (without "Template:" prefix here, A-F):

Special:Prefixindex/Template:Location_map_

Creating new maps

  1. Find an appropriate blank map in equirectangular projection (otherwise, coordinates will drift off, typically further north)
  2. Create a template named "Template:Location_map_locname" (copy the content of any other map template into it and enter appropriate values).
  3. Set default parameter values (using those parameter names), such as setting "mark" with image-file name and "marksize" for pixels wide/tall, or set default label font size ("label_size = 78" percent).
  4. Parameter names not used by "Template:Location_map" will be ignored by it, and only used for multiple-markers (such as defaulting "label2_size = 78" percent, or "mark2size=7" pixels).

Examples

Map with label "Pag" and "Anytown" (degrees)

[[image:Template:Location map Croatia|280px|Pag (Template:Location map Croatia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Pag
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Anytown_Anywhere
Pag (Template:Location map Croatia)

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Croatia
| width = 280
| float = right
| label = Pag
  | marksize = 8
  | pos = right
  | bg = yellow
  | lat_deg = 44 | lat_min = 26
  | lon_deg = 15 | lon_min = 3
| label2 = Anytown_Anywhere
  | mark2 = Rouge-Admin JollyRoger.svg
  | mark2size = 45
  | pos2 = bottom
  | bg2 = transparent
  | lat2_deg = 45 | lat2_min = 30
  | lon2_deg = 17 | lon2_min = 30
}}

Map with 3 labels (decimal)

[[image:Template:Location map Croatia|260px|Pag (Template:Location map Croatia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Pag
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Anytown

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

Anytown2
Anytown2
Pag (Template:Location map Croatia)

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Croatia
| width = 260
| float = right
| label = Pag
  | pos = right
  | marksize = 8
  | lat_deg = 44.44
  | lon_deg = 15.05
| label2 = Anytown
  | pos2 = bottom
  | bg2 = yellow
  | mark2size = 8
  | lat2_deg = 45.86
  | lon2_deg = 17.50
| label3 = Anytown2
  | pos3 = top
  | bg3 = lightgreen
  | lat3_deg = 46.23
  | lon3_deg = 18.43
}}

Example map with red triangle

Hispaniola (Template:Location map 100x100)
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Hispaniola
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

Cuba
Site of Hispaniola

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | 100x100
| image = LocationJamaica.svg
| float = right
| width = 250
| caption = Site of '''Hispaniola'''
| label = Hispaniola
  | position = left
  | background = #CCDDFF
  | marksize = 0
  | lat_deg = 39.8
  | lon_deg = 65.1
| label2 =
  | mark2 =Diamond_sheer_red_42.png
  | mark2size = 42
  | lat2_deg = 51.4
  | lon2_deg = 72.8
| label3 = Cuba
  | pos3 = left
  | mark3size = 0
  | lat3_deg = 60.8
  | lon3_deg = 66.0
}}

Map with some labels outside map

[[image:Template:Location map Croatia|260px|Pag (Template:Location map Croatia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Pag
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Anytown

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

Anytown2
Anytown2

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

North Croatia
Pag (Template:Location map Croatia)

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Croatia
| width = 260
| float = right
| label = Pag | position=right
  | marksize = 8
  | lat_deg = 44.44
  | lon_deg = 15.05
| label2 = Anytown
  | pos2 = bottom
  | bg2 = yellow
  | mark2size = 8
  | lat2_deg = 47.40
  | lon2_deg = 12.80
| label3 = Anytown2
  | pos3 = top
  | bg3 = lightgreen
  | lat3_deg = 41.98
  | lon3_deg = 18.43
| label4 = North Croatia
  | pos4 = left
  | bg4 = lightgreen
  | mark4size = 0
  | lat4_deg = 46.22
  | lon4_deg = 17.7
}}

Map with 9 markers (decimal)

[[image:Template:Location map Croatia|260px|Pag (Template:Location map Croatia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Pag
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Anytown

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

Anytown2
Anytown2

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

44.0 (latitude)
44.0 (latitude)

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

44.5
44.5

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

45.0
45.0

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

45.5
45.5

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

46.0
46.0

<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">

CROATIA
CROATIA
Pag (Template:Location map Croatia)

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Croatia
| width = 260
| float = right
| label = Pag
  | position = right
  | lat_deg = 44.44
  | lon_deg = 15.05
| label2 = Anytown
  | label2_size = 110
  | pos2 = bottom
  | background2 = yellow
  | lat2_deg = 45.86
  | lon2_deg = 17.50
| label3 = Anytown2
  | label3_size = 140
  | pos3 = top
  | background3 = green
  | lat3_deg = 46.23
  | lon3_deg = 18.43
| mark4 =Diamond_sheer_black_20.png
  | mark4size = 19
  | label4 = 44.0 (latitude)
  | lat4_deg = 44.00
  | lon4_deg = 13.5
| mark5 =Diamond_sheer_black_20.png
  | mark5size = 20
  | label5 = 44.5
  | lat5_deg = 44.50
  | lon5_deg = 13.5
| mark6 =Diamond_sheer_black_20.png
  | mark6size = 20
  | label6 = 45.0
  | lat6_deg = 45.00
  | lon6_deg = 13.5
| mark7 =Diamond_sheer_black_20.png
  | mark7size = 20
  | label7 = 45.5
  | lat7_deg = 45.50
  | lon7_deg = 13.5
| mark8 =Diamond_sheer_black_20.png
  | mark8size = 20
  | label8 = 46.0
  | lat8_deg = 46.00
  | lon8_deg = 13.5
| label9 = ''CROATIA''
  | label9_size = 165
  | mark9size = <!--label only-->
  | lat9_deg = 42.60
  | lon9_deg = 14.4
}}

Map with a custom label and text background

[[image:Template:Location map Croatia|280px|Imotski (Template:Location map Croatia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Imotski
Imotski in Croatia

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Croatia
| width = 280
| float = right
| caption = Imotski in Croatia
| label = Imotski
| position = right
| background = #FFFFDD
| lat_deg = 43.44
| lon_deg = 17.21
}}

Map with enlarged marker and label

[[image:Template:Location map Croatia|260px|Pag (Template:Location map Croatia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Pag
Pag Island in Croatia

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Croatia
| width = 260
| float = right
| caption = Pag Island in Croatia
| label = Pag
| label_size = 200
| position = right
| marksize = 14
| background = #FFFFDD
| lat_deg = 44.44
| lon_deg = 15.05
}}

Map with no caption

[[image:Template:Location map Bosnia|150px|Brčko (Template:Location map Bosnia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unrecognized punctuation character "[".%; height: 0; width: 0; margin: 0; padding: 0;">
Brčko

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Bosnia
| width = 150
| float = right
| caption =
| label = Brčko
| position = left
| lat_deg = 44.87
| lon_deg = 18.81
}}

Western Hemisphere

[[image:Template:Location map United Kingdom|180px|Lockerbie (Template:Location map United Kingdom)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unexpected < operator.%; height: 0; width: 0; margin: 0; padding: 0;">
Lockerbie
Lockerbie in Scotland

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | United Kingdom
| width = 180
| float = right
| caption = Lockerbie in Scotland
| label = Lockerbie
| position = right
| lat_deg=55 | lat_min=07 | lat_sec=16
| lat_dir=N
| lon_deg=3  | lon_min=21 | lon_sec=19
| lon_dir=W
}}

Country that crosses 180° meridian

[[image:Template:Location map Russia|400px|Uelen (Template:Location map Russia)]]
<div style="position:absolute; z-index:2; top: Expression error: Unrecognized punctuation character "[".%; left: Expression error: Unexpected < operator.%; height: 0; width: 0; margin: 0; padding: 0;">
Uelen
Uelen (Template:Location map Russia)

Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".Expression error: Unrecognized punctuation character "[".

{{Location map many/sandbox2 | Russia
| width = 400
| float = right
| label = Uelen
| position = left
| background = #FFFFDD
| lat_deg=66  | lat_min = 09
| lat_dir=N
| lon_deg=169 | lon_min = 48
| lon_dir=W
}}

Implementation notes

The map with markers/labels is implemented as nested HTML divisions. The map-image is in an HTML division, containing each point as a percent-locator division containing a marker-image sub-division plus a label sub-division. Each point is calculated (for a percent-locator division) with X or Y coordinate "XX.X%" or "YY.Y%" as follows:

  • The div-tag is "<div style="position: absolute; z-index: 2; top: XX.X%; left: YY.Y%; ...>"
  • For placing latitude, the calculation is:
  • XX.X% = 99.9 * (top - (lat_deg + latmin/60 +latsec/3600) ) / (top - bottom)
  • If lat_deg is empty, the combined decimal latitude is used from "lat".
  • If lat_dir is "S" (south), the latitude is multiplied by -1.
  • (Note latitude is positioned in reverse, from top of map downward.)
  • For placing longitude, the calculation is:
  • YY.Y% = 99.2 * ( (lon_deg + lonmin/60 +lonsec/3600) - left ) / (right - left)
  • If lon_deg is empty, the combined decimal longitude is used as "long".
  • If lon_dir is "W" (west), the longitude is multiplied by -1.
  • The div-tag is ended as "height: 0; width: 0; margin: 0; padding: 0;">".
  • Within that division the marker/label sub-divisions are coded as:
  • <div style="position: relative text-align: center; ...">.
  • For label position, the options are shifted as:
  • when position=left, adds "left: -6.5em; text-align: right;"
  • when position=right, adds "left: 0.5em; text-align: left;"
  • when position=top, adds "top:-2.65em; left:-3em; text-align: center;"
  • when position=bottom, adds "top:-0.15em; left: -3em; text-align: center;" to div-tag.

See also