Template:Map

From Secrets of Grindea Wiki
Jump to navigation Jump to search


Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:Map/doc to edit this documentation. (How does this work?)

Template:Map allows you to display maps of SoG areas and tag certain locations for display.

It is similar in idea to Template:Overlay Simple, but doesn't implement grids or a scroll bar; instead, the image (and the indicators) can be moved around if the map is really large.

The template makes a call to Module:Map, which implements the HTML and CSS. There's also some JavaScript code in Mediawiki:Common.js that implements the map dragging.

The parameters imageWidth and imageHeight must be specified, and they must correspond to the map's width and height for reliable displaying.

Parameters

Parameter Description Values (Lua)
groups Number of groups to use in the legend.

The template will try to spread out the legend entries across the number of groups specified.

  • Default Value: 3
  • Allowed Range: 1 - 5
anchor An anchor for linking to this element.

If specified, a with an id #anchor will be generated.

  • Default Value: (empty)
imageWidth

imageHeight

Specifies the image's width and height.

This value is used for positioning the indicators, and is also important for proper display.

The template cannot deduce these parameters on its own (for the time being).

  • Default Value:
    • imageWidth: 64
    • imageHeight: 64
  • Note: the default values act as a failsafe and should not be defaulted to
imageScale Scaling value to be used for the image.

imageWidth and imageHeight are multiplied by this value internally.

You should use this for resizing, instead of specifying new widths and heights manually.

  • Default Value: 1
  • Allowed range: 0.1 - 5
image The image to be used as a map.
  • Default Value: Placeholder.png
  • Note: the default value acts as a failsafe and should not be defaulted to
containerWidth

containerHeight

Specifies the max width (in %) and max height (in px) of the template container.

If you want to limit the max size of the container, you can lower these values.

  • Default Value:
    • containerWidth: 100%
    • containerHeight: 720px
legend Text to display as title for the legend table
  • Default Value: Locations
posN

posNx

posNy

posNlink

Specifies the properties of an indicator, where N is the indicator's index (ranging from 1 to 32).
  • posN holds the indicator's display text
  • posNx holds the indicator's horizontal position (from the left) on the map (in %)
  • posNy holds the indicator's vertical position (from the top) on the map (in %)
  • posNlink holds the link to be used for the indicator
  • posNitem holds the ID of a SoG item to be used instead of the N for the icon (for chests)
    • If specified, the underlying circle will be white-colored

If an element has posNx = 25 and posNy = 50, it will be displayed at the image's equator, at 1/4th of the image's width from the left edge.

  • Default Value:
    • posN: (empty) [i.e. won't render an indicator with this index]
    • posNx: 50
    • posNy: 50
    • posNlink: (empty)
    • posNitem: (empty)
      • If retrieving the sprite from Module:Item failed, Placeholder.png is used
  • Note: the default values for the positions acts as a failsafe and should not be defaulted to

Usage Example

{{Map

|imageScale = 0.6

|imageWidth = 2060
|imageHeight = 800
|containerHeight = 600
|image = PMUpper_0.890b.png

|legend = Locations (Upper Pillar Mountains)

|pos1 = Startington
|pos1x = 20
|pos1y = 4
|pos1link = Startington#Map

|pos2 = Middle Pillar Mountains
|pos2link = 
|pos2x = 84
|pos2y = 97

|pos3 = Teleport Plate
|pos3link = Teleport Plates
|pos3x = 25.3
|pos3y = 13

|pos4 = Mumrik
|pos4x = 71.5
|pos4y = 32.7
|pos4link = Mumrik
}}
PMUpper 0.890b.png
Startington1
Middle Pillar Mountains2
Teleport Plate3
Mumrik4
You can move the map around by dragging
Locations (Upper Pillar Mountains)
1. Startington2. Middle Pillar Mountains3. Teleport Plate
4. Mumrik