Template:OSM Location map/cssmapping
{{#ifexpr:{{{x1|0}}}<{{{width|400}}} and {{{y1|0}}}<{{{height|250}}}| {{#switch:{{Str left |{{{label-line|0}}}| 1}}
| 1|3|4 = {{OSM Location map/cssline| x1={{{x1|30}}}| y1={{{y1|40}}}
| x2={{#expr:{{{x1|30}}}+{{{ldx|10}}} }}| y2={{#expr:{{{y1|40}}}+{{{ldy|50}}} }}
|outline-width=2| outline-style=solid| shape-outline={{#ifeq:{{Str left |{{{label-line|}}}| 1}} |3 |{{{label-color|blue}}}|{{{shape-color|blue}}} }} }}
|2= {{#ifeq:{{{shape|}}}|panel|{{OSM Location map/cssline
| x1={{#expr:{{{x1|30}}}+{{{mark-width|30}}}/2}}| y1={{#expr:{{{y1|40}}}+{{{mark-height|30}}}/2}}
| x2={{{x2|50}}}| y2={{{y2|60}}}
| outline-width={{#invoke:String2 |split |txt={{{label-line|}}}|sep=,|idx=2}}
| outline-style={{#invoke:String2 |split |txt={{{label-line|}}}|sep=,|idx=3}}
| shape-outline={{{shape-outline|darkgrey}}} | double={{#invoke:String2 |split |txt={{{label-line|}}}|sep=,|idx=4}} }}
|{{OSM Location map/cssline| x1={{{x1|30}}}| y1={{{y1|40}}}
| x2={{{x2|50}}}| y2={{{y2|60}}}
| outline-width={{#invoke:String2 |split |txt={{{label-line|}}}|sep=,|idx=2}}
| outline-style={{#invoke:String2 |split |txt={{{label-line|}}}|sep=,|idx=3}}
| shape-outline={{{shape-outline|darkgrey}}} | double={{#invoke:String2 |split |txt={{{label-line|}}}|sep=,|idx=4}} }} }} }}
{{#ifeq:{{Str left |{{{label-line|0}}}| 1}}|3|
{{#ifeq:{{#invoke:String2 |split |txt={{{label-line|}}}|sep=!|idx=2}}|0||
}}
}}{{#ifeq:{{{mark-width|1}}}|0||{{#switch:{{{shape|}}}
|curveA= {{OSM Location map/cssline|option=curveA
|x1={{{x1|150}}}|y1={{{y1|150}}}|w={{{mark-width|55}}}|cw=0| outline-width={{{outline-width|6}}}| angle={{{shape-angle|0}}}| shape-outline={{{shape-outline|black}}}| outline-style={{{outline-style|solid}}} }}
|curveC={{OSM Location map/cssline|option=curveA
|x1={{{x1|150}}}|y1={{{y1|150}}}|w={{{mark-width|55}}}|cw=1| outline-width={{{outline-width|6}}}| angle={{{shape-angle|0}}}| shape-outline={{{shape-outline|black}}}| outline-style={{{outline-style|solid}}} }}
|ruleA= {{OSM Location map/cssline|option=ruleA
|x1={{{x1|150}}}|y1={{{y1|150}}}|w={{{mark-width|85}}}| outline-width={{{outline-width|6}}}| angle={{{shape-angle|0}}}| shape-outline={{{shape-outline|black}}}| outline-style={{{outline-style|solid}}} }}
|}}
|rule = top: {{#expr:{{{y1|120}}}-( {{{outline-width|2}}} /2) }}px;
left: {{#expr:{{{x1|40}}}-({{{mark-width|50}}}/2) }}px;
width: {{{mark-width|50}}}px;
height: 1px; background-color: transparent; color:inherit;
outline-width: 0; border-bottom: {{{outline-width|12}}}px {{{outline-style|solid}}} {{{shape-outline|blue}}};
transform: rotate( {{{shape-angle|20}}}deg);">
|circle = top: {{#expr:{{{y1|140}}}-({{{mark-width|15}}}/2)}}px;
left: {{#expr:{{{x1|240}}}-(({{{mark-width|15}}}-1)/2)}}px;
width: {{{mark-width|15}}}px;
height: {{{mark-width|15}}}px;
border-radius: 50%;
background-color: {{{shape-color|lightblue}}}; color:inherit;">
|square = top: {{#expr:{{{y1|40}}}-({{{mark-width|50}}}/2)}}px;
left: {{#expr:{{{x1|40}}}-({{{mark-width|50}}}/2)}}px;
width: {{{mark-width|50}}}px;
height: {{{mark-width|50}}}px; transform: rotate({{{shape-angle|0}}}deg);
background-color: {{{shape-color|lightblue}}}; color:inherit;">
|diamond = top: {{#expr:{{{y1|40}}}-({{{mark-width|50}}}/2*0.8)}}px;
left: {{#expr:{{{x1|40}}}-({{{mark-width|50}}}/2*0.8)}}px;
width: {{#expr:{{{mark-width|50}}}*0.8}}px;
height: {{#expr:{{{mark-width|50}}}*0.8}}px; transform: rotate(45deg);
background-color: {{{shape-color|lightblue}}}; color:inherit;">
|triangle|trangle-up|up = top: {{#expr:{{{y1|40}}}-({{{mark-width|50}}}/2)}}px;
left: {{#expr:{{{x1|40}}}-({{{mark-width|50}}}/2)}}px;
transform: rotate({{{shape-angle|0}}}deg);
width: 0; height: 0; outline-width: 0px;
border-left: {{#expr:{{{mark-width|14}}}/2}}px solid transparent;
border-right: {{#expr:{{{mark-width|14}}}/2}}px solid transparent;
border-bottom: {{{mark-width|14}}}px solid {{{shape-color|lightblue}}};">
|itriangle = top: {{#expr:{{{y1|40}}}-({{{mark-height|50}}}/2)}}px;
left: {{#expr:{{{x1|40}}}-({{{mark-width|50}}}/2)}}px;
transform: rotate({{{shape-angle|0}}}deg);
width: 0; height: 0; outline-width: 0px;
border-left: {{#expr:{{{mark-width|28}}}/2}}px solid transparent;
border-right: {{#expr:{{{mark-width|28}}}/2}}px solid transparent;
border-bottom: {{{mark-height|45}}}px solid {{{shape-color|lightblue}}};">
|box = top: {{#expr:{{{y1|40}}}-({{{mark-height|50}}}/2)}}px;
left: {{#expr:{{{x1|40}}}-({{{mark-width|50}}}/2)}}px;
width: {{{mark-width|50}}}px;
height: {{{mark-height|50}}}px; transform: rotate({{{shape-angle|0}}}deg);
border-radius: {{{mark-corner|0}}}px;
background-color: {{{shape-color|lightblue}}}; color:inherit;">
|ellipse= 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;
border-radius: 50%;
background-color: {{{shape-color|lightblue}}}; color:inherit;">
|panel= top: {{{y1|40}}}px;
left: {{{x1|40}}}px;
width: {{{mark-width|65}}}px;
height: {{{mark-height|18}}}px;
border-radius: {{{mark-corner|3}}}px;
transform: rotate({{{shape-angle|0}}}deg);
background-color: {{{shape-color|lightblue}}}; color:inherit;">
|image= top: {{#expr:{{{y1|140}}}-({{{mark-height|14}}}/2)+{{min|({{{mark-height|14}}}*0.5)-12|0}} }}px;
left: {{#expr:{{{x1|240}}}-({{{mark-width|14}}}-1)/2}}px;
background-color:transparent; color:inherit;
transform: rotate({{{shape-angle|0}}}deg);">file:{{{mark
|#default=outline-width: 0px;">}} }}
{{#ifeq:{{{label-line|0}}}|4|
{{#ifeq:{{str count|{{{mark-title|}}}|[}}|0
|{{{numbered|}}}
|{{delink|wikilinks=target}}{{!}}{{{numbered|}}}]]}}{{#if:{{{label|}}}|: }} }}{{{label|}}}
{{#ifexpr:{{{mark-width|0}}}>1|{{#ifeq:{{{numbered|0}}}|0||{{#ifeq:{{{label-line|0}}}|4||{{{numbered|15}}}
}} }} }}{{#ifeq:{{str count|{{{mark-title|}}}|[}}|0||
}} }} Usage:
- label= parameter adds text on a transparent background at point x1,y1, using label-color, label-size, label-angle, label-pos=left/right/top/bottom.
- shape=circle, square, diamond, triangle are equel width centered on x1,y1, and use mark-size.
- box, ellipse,itriangle allow mark-size=w,h to set width and height. A third number for box sets corner-radius.
- shape=panel has its top-left corner at x1,y1, places text within rather than beside the shape, and uses mark-size, border-radius, shape-angle.
- shape=image, uses the value in 'mark' or default red pog. Set mark-size. Height may be needed to align labels correctly, but doesn't affect the image itself.
- A 'photo-panel' option creates a 'standard' 50px high panel, adds a photo to left or right. A width dimension is needed to match the panel edge)
- All shapes can also set shape-color and optional opacity, and a shape-outline parameter to set color, width, opacity, style of an outline
- Shapes can also have auto- or manual-numbers to give a sequence of numbered shapes.
- Labels can optionally have a line to connect to their shape, as can shape-numbers if the shapes are congested.
- label-size can optionally include a plain background and/or 1px black outline around the label. eg label-size=12,outline,background