Template:Location map many: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Wikid77
reworded closing divisions
meta>Wikid77
rewrote to fix marker #9 overlapping caption; expanded comments; tested
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
-- Template for image with markers/labels (see bottom "NOTES")
-- Template for image with markers/labels (see bottom "NOTES")
-->
--
<includeonly><div style="width: {{#expr: {{{width|240}}} + 2 }}px; {{#if: {{{caption|}}}  
--  Warning: Code multi-nested top to bottom.
----------------------------------------------- Begin box division
--><div style="width: {{#expr: {{{width|240}}} + 2 }}px; {{#if: {{{caption|}}}  
   | padding: 3px; border: 1px solid {{#if: {{{border|}}}  
   | padding: 3px; border: 1px solid {{#if: {{{border|}}}  
     | {{{border|none}}}  
     | {{{border|none}}}  
Line 16: Line 18:
   | ;background:#F9F9F9"|"
   | ;background:#F9F9F9"|"
   }}><!--
   }}><!--
----------------------------------------------------- Map division
---------------------------------------------- Begin Map division
--><div style="position: relative;{{#ifeq: {{{border|}}} | none |  
--><div style="position: relative;{{#ifeq: {{{border|}}} | none |  
   |border: 1px solid {{#if: {{{border|}}}  
   |border: 1px solid {{#if: {{{border|}}}  
Line 22: Line 24:
     | {{#if:{{{caption|}}}|#CCCCCC|none}}
     | {{#if:{{{caption|}}}|#CCCCCC|none}}
   }};
   }};
}} padding: 0px; width: {{{width|240}}}px"><!-- specify Map -->[[image:{{#if: {{{AlternativeMap|}}} | {{{AlternativeMap}}} | {{Location map {{{1}}}|image}} }}|{{{width|240}}}px|{{#if: {{{caption|}}}  
}} padding: 0px; width: {{{width|240}}}px">[[image:{{#if: {{{AlternativeMap|}}} | {{{AlternativeMap}}} | {{Location map {{{1}}}|image}} }}|{{{width|240}}}px|{{#if: {{{label|}}}  
   | {{{caption|}}}
   | {{{label}}}  
   | {{#if: {{{label|}}}
   | {{PAGENAME}}  
    | {{{label}}}
}}<!-- endif label--> ({{Location map {{{1}}}|name}})]]<br /><!--
    | {{PAGENAME}}  
}} ({{Location map {{{1}}}|name}})
}}<!-- endif caption--> ]]<br /><!--
================================================ Put Bottom Caption
--  >{{#if: {{{caption|}}}  --OMIT--
  | {{{caption|}}}
  | {{#if: {{{label|}}}
    | {{{label}}}
    | {{PAGENAME}}
}} ({{Location map {{{1}}}|name}})
}}<!-- endif caption--
================================================== Marker/Label #1
================================================== Marker/Label #1
--><div style="position: absolute; z-index: 2; top: {{#expr:  
--><div style="position: absolute; z-index: 2; top: {{#expr:  
Line 348: Line 339:
     | background-color: {{{background8}}};
     | background-color: {{{background8}}};
   }}">{{{label8|}}}</span></div><!-- end-div label8 -->
   }}">{{{label8|}}}</span></div><!-- end-div label8 -->
}}<!-- endif-else position8 --></div><!--end-div point#8--
}}</div><!--end-div point#8--
================================================= Marker/Label #9
================================================= Marker/Label #9
--><div style="position: absolute; z-index: 2; top: {{#expr:
  100 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat9_deg|}}}
    | {{#expr: {{#ifeq: {{{lat9_dir|}}}|S|-1|1}} * ({{{lat9_deg|0}}} + ({{{lat9_min|0}}} / 60) + ({{{lat9_sec|0}}} / 3600)) }}
    | {{{lat9|0}}}
  }}) / ({{Location map {{{1}}}|top}} - {{Location map {{{1}}}|bottom}}) round 1
}}%; left: {{#expr:
  {{#expr:{{#if:{{Location map {{{1}}}|crosses180}}|{{#ifeq: {{{lon9_dir|}}}|W|-36000/({{Location map {{{1}}}|left}}-{{Location map {{{1}}}|right}})|}}|}}}} + 100 * ({{#if: {{{lon9_deg|}}}
    | {{#expr: {{#ifeq: {{{lon9_dir|}}}|W|-1|1}} * ({{{lon9_deg|0}}} + ({{{lon9_min|0}}} / 60) + ({{{lon9_sec|0}}} / 3600)) }}
    | {{{long9|0}}}
  }} - {{Location map {{{1}}}|left}}) / ({{Location map {{{1}}}|right}} - {{Location map {{{1}}}|left}}) round 1
}}%; height: 0; width: 0; margin: 0; padding: 0;"><!--
----------------------------------------------- Marker#9 division
--><div style="position: relative; text-align: center; {{#if: {{{mark9size|}}}  
--><div style="position: relative; text-align: center; {{#if: {{{mark9size|}}}  
   | left: -{{#expr: {{{mark9size}}} / 2 round 0 }}px; top: -{{#expr: {{{mark9size}}} / 2 round 0 }}px; width: {{{mark9size}}}px; font-size: {{{mark9size}}}px;  
   | left: -{{#expr: {{{mark9size}}} / 2 round 0 }}px; top: -{{#expr: {{{mark9size}}} / 2 round 0 }}px; width: {{{mark9size}}}px; font-size: {{{mark9size}}}px;  
Line 362: Line 365:
   | {{{label9}}}  
   | {{{label9}}}  
   | {{PAGENAME}}  
   | {{PAGENAME}}  
}}]]</div><!-- end-div marker9
}}]]</div><!-- end-div marker9 --
-------------------------------------------------- Label #9
-------------------------------------------------- Label #9
-->{{#ifeq: {{{position9|}}} | none  
-->{{#ifeq: {{{position9|}}} | none  
Line 376: Line 379:
   }}">{{{label9|}}}</span></div><!-- end-div label9 -->
   }}">{{{label9|}}}</span></div><!-- end-div label9 -->
}}</div><!--end-div point#9--
}}</div><!--end-div point#9--
-------------------------------------------------- Format Caption
================================================ End All Markers
-->
--></div><div style="font-size: 90%">{{{caption|{{#if: {{{label|}}}  
</div><div style="font-size: 90%">{{{caption|{{#if: {{{label|}}}  
   | {{{label}}}  
   | {{{label}}}  
   | {{PAGENAME}}  
   | {{PAGENAME}}  
}} ({{Location map {{{1}}}|name}})}}}</div>
}} ({{Location map {{{1}}}|name}})}}}</div><!-- end-div caption --
<!-- ---------------------------------------------------- -->
--></div><!-- end-div overall box -->
</div><!-- end-div map part --
<!-- </div></div> <!--force any divisions closed -->
==================================================
<!-- </div> !-- end-div bordered box -->
<!-- </div></div><!--force any divisions closed -->
</includeonly><noinclude><!--
</includeonly><noinclude><!--
--
--
-- NOTES:
-- NOTES:
--  This code generates an HTML division to show the map image,
--  This code generates nested HTML divisions for a box-division
--  overlayed with a marker-image division & label division,
--  containing a map-division with nested point-divisions, each
--  for each pair of up to 9 marker/label points.
--  having a nested marker-image division & label division (for
--  each marker/label point), following by a caption-division.
--
--
--  The "map image" can be any image, allowing markers/labels
--  The "map image" can be any image, allowing markers/labels to
--  to annotate any picture. Set marksize=0 to show labels only.
--  annotate any picture. Set each markXsize=0 to show labels only.
--
--
--  [ These comments take < 1 second per 5,000 comment lines. ]
--  [ These comments take < 1 second per 5,000 comment lines. ]
Line 403: Line 403:
-- 06Sep07 Created/debugged to allow 3 markers.
-- 06Sep07 Created/debugged to allow 3 markers.
-- 08Sep07 Expanded with 6 more markers #4-#9 (of eventual 20).
-- 08Sep07 Expanded with 6 more markers #4-#9 (of eventual 20).
-- 08Sep07 Debugged marker #9 for extraneous marker in caption.
-->
-->
{{/doc}}
{{/doc}}

Revision as of 15:55, 8 September 2007