Template:OSM Location map/cssmapping: Difference between revisions

Content deleted Content added
no dot, and slight j tweak
implement tested version of wikilinking for shapes with a mark-title link
Line 36:
outline-style: {{{outline-style|solid}}};
outline-color: {{{shape-outline|blue}}};
{{#switch:{{{shape|itriangleimage}}}
|line = left:{{#expr:{{{x1|40}}}+( ( {{{x2|80}}}-{{{x1|40}}} )/2) - (sqrt( ( {{{x2|80}}}-{{{x1|40}}} )^2 + ( {{{y2|60}}}-{{{y1|30}}} )^2 )/2)+( {{{outline-width|2}}}/2)-1 }}px;
top: {{#expr:{{{y1|30}}}+( ( {{{y2|60}}}-{{{y1|30}}} )/2)-( {{{outline-width|2}}} /2) }}px;
Line 101:
left: {{#expr:{{{x1|40}}}-({{{mark-width|14}}}-1)/2}}px;
background-color:transparent;
transform: rotate({{{shape-angle|0}}}deg);">[[file:{{{mark|Red pog.svg}}}{{!}}{{#expr:{{{mark-width|14}}}+2}}px{{!}}alt={{{mark-title|}}}{{!}}link=]]</div>
|#default="></div>}} }}<div style="display:inline-block; position: absolute; <!-- After shape, print the label, if any ------ -->
{{#ifexpr:{{Str find|{{{shape|}}}|panel}}=1 and {{Str left |{{{label-line|0}}}| 1}} != 3 <!-- if its a panel, but not photo-panel -->
Line 175:
}} }}
background-color:transparent; line-height: normal; transform: rotate({{{label-angle|0}}}deg)"><span style="color: {{{label-color|black}}};
font-size: {{{label-size|13}}}px; font-weight:normal;">{{#ifeq:{{{label-line|0}}}|4|{{{numbered|}}}. |}}{{{label|}}}</span></div>{{#ifexpr:{{{mark-width|0}}}>1|{{#ifeq:{{{numbered|0}}}|0||{{#ifeq:{{{label-line|0}}}|4||<div style="display:inline-block; position: absolute;
{{#ifeq:{{{label-line|0}}}|4|
{{#ifeq:{{str count|{{{mark-title|}}}|[}}|0
|{{{numbered|}}}. <!-- just the number or make it a wikilink if there is one in mark-title -->
|[[{{delink|[[{{String split |{{String split |{{{mark-title|}}}|"]"]|1}}|"["[|2}}]]|wikilinks=target}}{{!}}{{{numbered|}}}. ]]}} }}{{{label|}}}</span></div>{{#ifexpr:{{{mark-width|0}}}>1|{{#ifeq:{{{numbered|0}}}|0||{{#ifeq:{{{label-line|0}}}|4||<div style="display:inline-block; position: absolute;
top: {{#expr:{{{y1|40}}}-( {{{mark-height|15}}}*0.5) }}px;
left: {{#expr:{{{x1|40}}}+2-( {{str len|{{{numbered|15}}} }} * ( {{{mark-height|15}}}-4.2 )/2.8 ) }}px;
Line 181 ⟶ 185:
background-color:transparent;
line-height: normal;"><span style="color: white;
font-size: {{#ifexpr:{{{mark-height|13}}}>13|{{#expr:{{{mark-height|15}}}-4}}|{{{mark-height|15}}} }}px; font-weight:bold;">{{{numbered|15}}}</span></div>}} }} }}{{#ifeq:{{str count|{{{mark-title|}}}|[}}|0||<noinclude>!-- Usage:add an invisible square with a link extracted from mark-title, if one is available -->
<div style="display:inline-block; position: absolute;
outline-width: 0px;
top: {{#expr:{{{y1|40}}}-({{{mark-height|50}}}/2)}}px;
left: {{#expr:{{{x1|40}}}-(({{{mark-width|50}}}-1)/2)}}px;
width: {{{mark-width|50}}}px;
height: {{{mark-height|50}}}px;
background-color: transparent;">[[file:Invisible Square.svg{{!}}{{#expr:{{{mark-width|14}}}+2}}px{{!}}alt={{{mark-title|}}}{{!}}link={{delink|[[{{String split |{{String split |{{{mark-title|}}}|"]"]|1}}|"["[|2}}]]|wikilinks=target}} ]]</div>}}<noinclude> Usage:
 
*label= parameter adds text on a transparent background at point x1,y1, using text-color, text-size, text-angle, label-pos=left/right/top/bottom.