Module
LinesOverlay/doc
From Dogcraft Wiki
This is the documentation page for Module:LinesOverlay
The {{LinesOverlay}} template uses Module:LinesOverlay to draw lines and place icons based on coordinates. This is intended for marking connections and facilities of the transport networks on the Dogcraft Server to be overlayed on a map. This module uses line by line markup for generating the lines and icons.
This template is intended to be used to create an overlay to be overlayed on a map, but can still be used for other purposes if so desired. The lines it creates are not particularly nice at sharp corners, as due to the limitations of Mediawiki lines are drawn with html <div> elements.
Usage
This template can generate a effectively unlimited number of lines and/or icons. It is important to note however, that this template only accepts a single parameter: a block of text of special markup.
Template opener
Open a LinesOverlay template with the template identifier: {{LinesOverlay|
Lines Overlay Markup
The markup is parsed line by line, meaning that every line of text given to the template acts as one parameter.
Please note that spaces ' ' and line breaks '\n' are significant in markup for this template and should only be used where needed.
Generally pieces of information are sperated by a single space ' ' in this templates markup and each line of markup acts like a parameter and provides a full set of information for one element. Every line begins with a line identifier and this is followed by information for this identifier.
This template accepts 3 types of information in markup: info, icon and line
Coordinate blocks
The template markup accepts many sets of coordinates, which are all specified as a coordinate block.
A coordinate block consists of a X and a Z coordinate separated by a comma ','.
For example the coordinates X:500, Z:300 translate to the following coordinate block: 500,300
The info line
info is an optional line that can be specified in markup. If used, this line should be the first under the template opener.
The info line can set a coordinate offset and a specific size and thus aspect ratio of the output.
The info line begins with the info
identifier, which is followed by 2 coordinate blocks.
The first coordinate block specifies offset coordinates for the output, which sets the top-left corner of the output to the given coordinates. The default for this is 0,0.
The second coordinate block specifies a custom size of the output. The x coordinate in this case specifies width and the z coordinate specifies height. The default for this is 500,500.
Example
info 500,-1000 1000,500
This will set the top-left corner of the output to be at coordinates X:500, Z:-1000 and will set the width of the output to be 1000 and the height to be 500, making the output twice as wide as it is high.
Icons
In addition to drawing lines, you can also place specific icons at specific coordinates with this template.
There are 4 predefined icons and you have the ability to specify a custom FontAwesome icon as well.
The 4 predefined icons are:
station
port
shelter
portal
The predefined icons use the identifier shown above and accept a single coordinate block after the identifier. This coordinate block specifies the coordinates where the icon will be located.
A custom icon can be specified using the icon
identifier.
This identifier accepts 1 coordinate block and after that a unspecified number of css class names. This can be used with FontAwesome classes to specify an arbitrary icon.
The coordinate block, similar to the predefined icons, specifies the coordinates at which the icon will be located.
The css class names are inserted into the class attribute of a <i> html tag. If FontAwesome classes are used here, this can result in a FontAwesome icon being displayed.
Markup | Result |
---|---|
station 500,354 |
Located at coordinates X:500, Z:354 |
icon 500,354 fa-solid fa-door-open |
Located at coordinates X:500, Z:354 |
icon 845,-512 fa-solid fa-sailboat fa-house |
Located at coordinates X:845, Z:-512 1 |
icon 845,-512 fa-solid fa-sailboat green |
Located at coordinates X:845, Z:-512 2 |
icon 845,-512 fa-solid fa-sailboat otherclass |
Located at coordinates X:845, Z:-512 2 |
1 Note that multiple different icons overwrite each other and only one of the icon classes will have effect, thus only showing one icon.
2 Note that the class "otherclass" is not styled in any way on this page and thus has no effect. The class green sets the color to green, thus changing the color of the icon.