Template:Location map: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Plastikspork
m (Undid revision 373688564 by Plastikspork (talk))
meta>Plastikspork
(Slightly more robust width parameter handling)
Line 1: Line 1:
<includeonly><div style="width: {{#expr: {{{width|240}}} + 2 }}px; {{#if: {{{caption|}}}
<includeonly><div style="width: {{#expr: {{#if:{{{width|}}}|{{{width}}}|240}} + 2 }}px; {{#if: {{{caption|}}}
   | padding: 3px;{{#ifeq: {{{border|}}} | none || border: 1px solid {{#if: {{{border|}}} | {{{border}}} | #CCC }};}} margin: 3px;
   | padding: 3px;{{#ifeq: {{{border|}}} | none || border: 1px solid {{#if: {{{border|}}} | {{{border}}} | #CCC }};}} margin: 3px;
}} float:{{#switch:{{{float|}}}|"center"|center=none|"left"|left=left|"right"|right=right|"none"|none=none|right}}; clear:{{#switch:{{{float|}}}|"center"|center=both|"left"|left=left|"right"|right=right|"none"|none=none|right}};{{#if: {{{caption|}}} | background:#F9F9F9; }}"><div style="position: relative;{{#if: {{{caption|}}}
}} float:{{#switch:{{{float|}}}|"center"|center=none|"left"|left=left|"right"|right=right|"none"|none=none|right}}; clear:{{#switch:{{{float|}}}|"center"|center=both|"left"|left=left|"right"|right=right|"none"|none=none|right}};{{#if: {{{caption|}}} | background:#F9F9F9; }}"><div style="position: relative;{{#if: {{{caption|}}}
   | {{#ifeq: {{{border|}}} | none || border: 1px solid {{#if: {{{border|}}} | {{{border}}} | #CCC}};}}
   | {{#ifeq: {{{border|}}} | none || border: 1px solid {{#if: {{{border|}}} | {{{border}}} | #CCC}};}}
}} padding: 0px; width: {{{width|240}}}px">[[image:{{#if: {{{AlternativeMap|}}} | {{{AlternativeMap}}} | {{Location map {{{1}}}|image}} }}|{{{width|240}}}px|{{#if:{{{alt|}}}|{{{alt}}}|{{#if:{{{label|}}}|{{{label}}}|{{PAGENAME}}}} is located in {{Location map {{{1}}}|name}}}}]]<br /><div style="position: absolute; z-index: 2; top: {{#expr:
}} padding: 0px; width: {{#if:{{{width|}}}|{{{width}}}|240}}px">[[image:{{#if: {{{AlternativeMap|}}} | {{{AlternativeMap}}} | {{Location map {{{1}}}|image}} }}|{{#if:{{{width|}}}|{{{width}}}|240}}px|{{#if:{{{alt|}}}|{{{alt}}}|{{#if:{{{label|}}}|{{{label}}}|{{PAGENAME}}}} is located in {{Location map {{{1}}}|name}}}}]]<br /><div style="position: absolute; z-index: 2; top: {{#expr:
   100 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat_deg|}}}
   100 * ({{Location map {{{1}}}|top}} - {{#if: {{{lat_deg|}}}
     | {{#expr: {{#ifeq: {{{lat_dir|}}}|S|-1|1}} * ({{{lat_deg|0}}} + ({{{lat_min|0}}} / 60) + {{#if:{{{lat_sec|}}}|({{{lat_sec|0}}} / 3600)|0}}) }}
     | {{#expr: {{#ifeq: {{{lat_dir|}}}|S|-1|1}} * ({{{lat_deg|0}}} + ({{{lat_min|0}}} / 60) + {{#if:{{{lat_sec|}}}|({{{lat_sec|0}}} / 3600)|0}}) }}

Revision as of 21:12, 26 July 2010