Template:Map

From Old School Near-Reality Wiki
Jump to navigation Jump to search
Template documentation
This documentation is transcluded from Template:Map/doc. [edit] [history] [purge]
Template:Map invokes function map in Module:Map using Lua.

Used to generate regular, square, or pin maps or links. Default is a regular mapframe. For a list of available parameters see below.

To find coordinates of a specific map square, tools such as https://mejrs.github.io/osrs can be used.

Usage

Single

The caption is optional, for all other available parameters see below.

Simple Map Pin Map
{{Map|2613,3294|caption=Map Caption}} {{Map|x=2613|y=3294|mtype=pin|group=pinex}}
Map Caption

Shapes

Squares and rectangles can be drawn using the mtype parameter. Note that the point provided defines the centre of the shape. For squares, r defines half of the length of the square's edges, i.e. the shortest distance from its centre to one of its edges.

Square Rectangle
{{Map|3028,3306|r=3|mtype=square}} {{Map|3028,3306|squareX=3|squareY=8|mtype=rectangle}}

Multiple

Multiple points can be combined on one map, or used to create lines and shapes. Individual points can have their own specific parameters, for all available parameters see below. Points should be represented as unnamed arguments in the format |x,y| or |param:value,param2:value...|.

Pins {{Map|2900,3000|x:2930,y:3020,desc:This is a description,title:Pin title |x:2870,y:3080,iconWikiLink:You_are_here.gif,title:Image|mtype=pin|icon=redPin}} Lua error in Module:Map at line 715: attempt to index field 'GloopTweaks' (a nil value).
Line {{Map|2900,3000|x:2930,y:3020|3000,3020|mtype=line}}
Polygon {{Map|2500,3100|2500,3130|2520,3140|2540,3115|2520,3090|mtype=polygon}}
Polygon and pins {{Map|2500,3100|x:2500,y:3130,desc:This is a description,title:Pin title |2520,3140|2540,3115|2520,3090|mtype=pin-polygon|icon=greenPin|group=example}}

Maplinks

Any map can be rendered as a maplink instead of a mapframe by using |type=maplink. The |text= parameter can be used to change the text of the link.

Examples

{{Map|2613,3294|type=maplink}}

Maplink


{{Map|2613,3294|type=maplink|text=Maplink Text}}

Maplink Text


{{Map|2613,3294|type=maplink|text=}}


{{Map|x=2613|y=3294|type=maplink|mtype=pin|group=pinex}}

Maplink


{{Map|2500,3100|x:2500,y:3130,desc:This is a description,title:Pin title|2520,3140|2540,3115|2520,3090|type=maplink|mtype=pin-polygon|icon=greenPin|group=example}}

Maplink

Parameters

If pin type map is chosen and only x/y parameters are given ({{Map|x=2520|y=3140|mtype=pin}}) these x/y are also used as the pin location.

Template

  • type - Render as link to map, instead of map: |type=maplink
  • mapID - Map id (see Near-Reality:Map/mapIDs for a list) defaults to 0 (surface)
  • plane - The map plane (0 is surface)
  • mtype - Type of map, one of: pin, square, rectangle, polygon, line, pin-polygon, pin-line, circle
  • r - Radius of the marked area (in tiles) with |mtype=square or |mtype=circle
  • squareX - Width of the marked area with (in tiles) with |mtype=rectangle
  • squareY - Height of the marked area with (in tiles) with |mtype=rectangle
  • ptype - Type of pin description format, one of: item, object, npc, monster (defaults to XY coordinate description if no desc is provided)
  • caption - A caption for the map (has no effect with |type=maplink)
  • text - The text to show as a link instead of Maplink (used with |type=maplink)
  • align - The alignment, defaults to center
  • width - Width of the map (in px)
  • height - height of the map (in px)
  • zoom - override default zoom
  • x - X-coordinate for the center of the map
  • y - Y-coordinate for the center of the map
  • group - Group (all pins, shapes etc in the same group, on the same page, will appear on each others maps)
  • showPins - Displays a link to a new map of pinned objects below a mapframe. Only use with Infobox Map param! This sets mtype to square by default. (Pass in a desc param to make the pins have adequate descriptions)
  • If mtype is square, polygon or combos:
    • title - Title of the polygon (displays in popup on click)
    • description - Description of the polygon (displays in popup on click)
  • nopreprocess - Any value causes the template to output the html element and json instead of rendering the map/link
  • smw - Set to yes to set the Location JSON property. Set to hist to set the Historic Location JSON property. When not defined, no SMW properties are set.

Per Point

Will override the template params

  • plane - The map plane (0 is surface)
  • desc - Pin description (is appended to templates desc)
  • icon - The type of icon (pin) to display. Default is a green pin, possible values are: redPin, greenPin, bluePin, cyanPin, magentaPin, yellowPin, greyPin
  • iconWikiLink - Use an image on the wiki as a pin. Spaces should be replaced with _
For the following params if the param name is used, 1 number is expected and used for x and y, to specify individually use paramNameX and paramNameY eg ...,iconSizeX:20,...
  • iconSize - Size of the image used as a pin (resizes image)
  • iconAnchor - Location of the map point relative to the image, default is top left (top left of image is specified point on map), positive numbers run down and to the right
  • popupAnchor - Location of the popup relative to the image, default is iconAnchor (top left unless specified), [0,0] is the iconAnchor, positive numbers run down and to the right