Difference between revisions of "Template:Cape Cod overlay map"

From blackwiki
Jump to navigation Jump to search
imported>Grolltech
m (Grolltech moved page Template:Cape Cod Overlay Map to Template:Cape Cod overlay map: proper capitalization)
imported>Grolltech
(eliminate height param; instead, calculate it as 75% of width)
Line 2: Line 2:
 
|image = USA Mass Cape Cod upper lower.svg
 
|image = USA Mass Cape Cod upper lower.svg
 
|width = {{#if:{{{width|}}}|{{{width}}}|300}}
 
|width = {{#if:{{{width|}}}|{{{width}}}|300}}
|height = {{#if:{{{height|}}}|{{{height}}}|225}}
+
|height = {{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}
 
|columns = {{#if:{{{columns|}}}|{{{columns}}}|3}}
 
|columns = {{#if:{{{columns|}}}|{{{columns}}}|3}}
 
|float = {{#if:{{{float|}}}|{{{float}}}|right}}
 
|float = {{#if:{{{float|}}}|{{{float}}}|right}}
Line 24: Line 24:
 
|overlay1 = Bourne
 
|overlay1 = Bourne
 
|overlay1link = Bourne, Massachusetts
 
|overlay1link = Bourne, Massachusetts
|overlay1top = {{#expr: (132 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay1top = {{#expr: (132 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
|overlay1left = {{#expr: (67 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
+
|overlay1left = {{#expr: (69 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay2 = Falmouth
 
|overlay2 = Falmouth
 
|overlay2link = Falmouth, Massachusetts
 
|overlay2link = Falmouth, Massachusetts
|overlay2top = {{#expr: (169 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay2top = {{#expr: (171 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
|overlay2left = {{#expr: (62 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
+
|overlay2left = {{#expr: (64 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay3 = Sandwich
 
|overlay3 = Sandwich
 
|overlay3link = Sandwich, Massachusetts
 
|overlay3link = Sandwich, Massachusetts
|overlay3top = {{#expr: (129 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay3top = {{#expr: (129 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay3left = {{#expr: (94 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay3left = {{#expr: (94 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay4 = Mashpee
 
|overlay4 = Mashpee
 
|overlay4link = Mashpee, Massachusetts
 
|overlay4link = Mashpee, Massachusetts
|overlay4top = {{#expr: (162 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay4top = {{#expr: (162 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay4left = {{#expr: (92 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay4left = {{#expr: (92 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay5color = blue
 
|overlay5color = blue
 
|overlay5 = Barnstable
 
|overlay5 = Barnstable
 
|overlay5link = Barnstable, Massachusetts
 
|overlay5link = Barnstable, Massachusetts
|overlay5top = {{#expr: (143 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay5top = {{#expr: (145 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
|overlay5left = {{#expr: (126 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
+
|overlay5left = {{#expr: (130 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay6 = Yarmouth
 
|overlay6 = Yarmouth
 
|overlay6link = Yarmouth, Massachusetts
 
|overlay6link = Yarmouth, Massachusetts
|overlay6top = {{#expr: (142 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay6top = {{#expr: (142 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
|overlay6left = {{#expr: (168 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
+
|overlay6left = {{#expr: (170 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay7 = Dennis
 
|overlay7 = Dennis
 
|overlay7link = Dennis, Massachusetts
 
|overlay7link = Dennis, Massachusetts
|overlay7top = {{#expr: (125 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay7top = {{#expr: (125 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay7left = {{#expr: (184 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay7left = {{#expr: (184 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay8color = red
 
|overlay8color = red
 
|overlay8 = Brewster
 
|overlay8 = Brewster
 
|overlay8link = Brewster, Massachusetts
 
|overlay8link = Brewster, Massachusetts
|overlay8top = {{#expr: (120 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay8top = {{#expr: (120 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay8left = {{#expr: (212 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay8left = {{#expr: (212 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay9 = Harwich
 
|overlay9 = Harwich
 
|overlay9link = Harwich, Massachusetts
 
|overlay9link = Harwich, Massachusetts
|overlay9top = {{#expr: (140 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay9top = {{#expr: (140 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay9left = {{#expr: (213 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay9left = {{#expr: (213 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay10 = Chatham
 
|overlay10 = Chatham
 
|overlay10link = Chatham, Massachusetts
 
|overlay10link = Chatham, Massachusetts
|overlay10top = {{#expr: (141 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay10top = {{#expr: (141 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay10left = {{#expr: (239 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay10left = {{#expr: (239 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay11color = saddlebrown
 
|overlay11color = saddlebrown
 
|overlay11 = Orleans
 
|overlay11 = Orleans
 
|overlay11link = Orleans, Massachusetts
 
|overlay11link = Orleans, Massachusetts
|overlay11top = {{#expr: (111 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay11top = {{#expr: (111 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay11left = {{#expr: (239 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay11left = {{#expr: (239 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay12 = Eastham
 
|overlay12 = Eastham
 
|overlay12link = Eastham, Massachusetts
 
|overlay12link = Eastham, Massachusetts
|overlay12top = {{#expr: (84 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay12top = {{#expr: (84 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay12left = {{#expr: (236 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay12left = {{#expr: (236 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay13 = Wellfleet
 
|overlay13 = Wellfleet
 
|overlay13link = Wellfleet, Massachusetts
 
|overlay13link = Wellfleet, Massachusetts
|overlay13top = {{#expr: (51 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay13top = {{#expr: (51 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay13left = {{#expr: (225 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay13left = {{#expr: (225 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay14 = Truro
 
|overlay14 = Truro
 
|overlay14link = Truro, Massachusetts
 
|overlay14link = Truro, Massachusetts
|overlay14top = {{#expr: (28 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay14top = {{#expr: (28 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay14left = {{#expr: (214 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay14left = {{#expr: (214 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay15 = Provincetown
 
|overlay15 = Provincetown
 
|overlay15link = Provincetown, Massachusetts
 
|overlay15link = Provincetown, Massachusetts
|overlay15top = {{#expr: (3 * ({{#if:{{{height|}}}|{{{height}}}|225}}/225)) round 0}}
+
|overlay15top = {{#expr: (3 * ({{#if:{{{width|}}}|{{#expr: ({{{width}}} * 0.75) round 0}}|225}}/225)) round 0}}
 
|overlay15left = {{#expr: (171 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
|overlay15left = {{#expr: (171 * ({{#if:{{{width|}}}|{{{width}}}|300}}/300)) round 0}}
 
}}<noinclude>
 
}}<noinclude>

Revision as of 19:12, 24 May 2013

Template:Overlay

50px Template documentation[view] [edit] [history] [purge]

Usage

{{Cape Cod overlay map | width = Template:Varserif | columns = Template:Varserif | float = Template:Varserif }}

where:

|width= desired width of the map image; default is 300px. This also forms the basis of the height of the map image, which will be calculated as 75% of the width.
|columns= number of columns to display in the legend; default is 3.
|float= designates to which side of the article text the map should appear. Valid values are: left, right (default), and center.

Example

The map at the top of the page was made using all default values – that is, by using the following wikicode:

{{Cape Cod overlay map}}

Compare the map at the top of the page with the following example:

{{Cape Cod overlay map
 |width = 200
 |columns = 2
 |float = center 
}}
which produces:

Template:Overlay

See also