Template:Map

From Old School RuneScape Wiki
Jump to: navigation, search
Template documentation
This documentation is transcluded from Template:Map/doc. [edit] [purge]
Template:Map invokes function map in Module:Map using Lua.
(unf)
This template or section is incomplete and could do with improvement.
Reason: Radius and circle are undocumented. (Works with squares too.)
You can discuss this issue on the talk page or edit this template to improve it.

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}}
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}}

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

  • mapID - Map id (see RuneScape:Map/mapIDs for a list) defaults to 0 (surface)
  • plane - The map plane (0 is surface)
  • mtype - Type of map, one of: pin, square, polygon, line, pin-polygon, pin-line
  • 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
  • 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)
  • type - Render as link to map, instead of map: |type=maplink
  • 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)
    • text - The text to show as a link instead of Maplink (used with type=maplink)
  • 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