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") | ||
-- | -- | ||
-- 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"|" | ||
}}><!-- | }}><!-- | ||
---------------------------------------------- | ---------------------------------------------- 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" | }} padding: 0px; width: {{{width|240}}}px">[[image:{{#if: {{{AlternativeMap|}}} | {{{AlternativeMap}}} | {{Location map {{{1}}}|image}} }}|{{{width|240}}}px|{{#if: {{{label|}}} | ||
| {{{ | | {{{label}}} | ||
| {{PAGENAME}} | |||
}}<!-- endif label--> ({{Location map {{{1}}}|name}})]]<br /><!-- | |||
}}<!-- endif | |||
================================================== 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 --> | ||
}} | }}</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-- | ||
================================================ 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}})}}} | }} ({{Location map {{{1}}}|name}})}}}</div><!-- end-div caption -- | ||
--></div><!-- end-div overall box --> | |||
</div><!-- end-div | <!-- </div></div> <!--force any divisions closed --> | ||
<!-- </div></div><!--force any divisions closed --> | |||
</includeonly><noinclude><!-- | </includeonly><noinclude><!-- | ||
-- | -- | ||
-- NOTES: | -- NOTES: | ||
-- This code generates | -- This code generates nested HTML divisions for a box-division | ||
-- | -- containing a map-division with nested point-divisions, each | ||
-- | -- 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 | ||
-- | -- 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}} |