Template:MapLink/Sandbox/doc: Difference between revisions

From RuneRealm Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "{{No documentation}}")
 
No edit summary
 
Line 1: Line 1:
{{No documentation}}
{{documentation}}
Used to generate regular, square or pin maplinks. For a list of available parameters see [[#Parameters|below]].

==Usage==
===Single===
The caption is optional, for all other available parameters see [[#Parameters|below]].
{| class="center"
! Simple Map !! Pin Map
|-
| <code><nowiki>{{MapLink|2613,3294|text=Map link text}}</nowiki></code>
| <code><nowiki>{{MapLink|x=2613|y=3294|mtype=pin|group=pinex}}</nowiki></code>
|-
| {{MapLink|2613,3294|text=Map link text}}
| {{MapLink|x=2613|y=3294|mtype=pin|group=pinex}}
|}

===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 [[#Parameters|below]]. Points should be represented as unnamed arguments in the format <code>|x,y|</code> or <code>|param:value,param2:value...|</code>.

{|
! Pins
| <code><nowiki>{{MapLink|2900,3000|x:2930,y:3020,desc:This is a description,title:Pin title|x:2870,y:3080,iconWikiLink:You_are_here.png,title:Image|mtype=pin|icon=redPin}}</nowiki></code>
| {{MapLink|2900,3000|x:2930,y:3020,desc:This is a description,title:Pin title|x:2870,y:3080,iconWikiLink:You_are_here.png,title:Image|mtype=pin|icon=redPin}}
|-
! Line
| <code><nowiki>{{MapLink|2900,3000|x:2930,y:3020|3000,3020|mtype=line}}</nowiki></code>
| {{MapLink|2900,3000|x:2930,y:3020|3000,3020|mtype=line|text=Map with a line}}
|-
! Polygon
| <code><nowiki>{{MapLink|2500,3100|2500,3130|2520,3140|2540,3115|2520,3090|mtype=polygon}}</nowiki></code>
| {{MapLink|2500,3100|2500,3130|2520,3140|2540,3115|2520,3090|mtype=polygon}}
|-
! Polygon and pins
| <code><nowiki>{{MapLink|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}}</nowiki></code>
| {{MapLink|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 (<code><nowiki>{{Map|x=2520|y=3140|mtype=pin}}</nowiki></code>) these x/y are also used as the pin location.

===Template===
* <code>mapID</code> - Map id (see [[RuneScape:Map/mapIDs]] for a list) defaults to 0 (surface)
* <code>plane</code> - The map plane (0 is surface)
* <code>mtype</code> - Type of map, one of: <code>pin, square, polygon, line, pin-polygon, pin-line</code>
* <code>text</code> - The text to show as a link instead of ''MapLink'' (used with type=maplink)
* <code>zoom</code> - override default zoom
* <code>x</code> - X-coordinate for the center of the map
* <code>y</code> - Y-coordinate for the center of the map
* <code>group</code> - Group (all pins, shapes etc in the same group, on the same page, will appear on each others maps)
* If ''mtype'' is square, polygon or combos:
** <code>title</code> - Title of the polygon (displays in popup on click)
** <code>description</code> - Description of the polygon (displays in popup on click)
* <code>nopreprocess</code> - Any value causes the template to output the html element and json instead of rendering the maplink

===Per Point===
Will override the template params
* <code>plane</code> - The map plane (0 is surface)
* <code>desc</code> - Pin description (is appended to templates desc)
* <code>icon</code> - The type of icon (pin) to display. Default is a green pin, possible values are: <code> greenPin, redPin, greyPin</code>
* <code>iconWikiLink</code> - Use an image on the wiki as a pin. Spaces should be replaced with <code>_</code>
::For the following params if the param name is used, 1 number is expected and used for x and y, to specify individually use <code>paramNameX</code> and <code>paramNameY</code> eg <code>...,iconSizeX:20,...</code>
:* <code>iconSize</code> - Size of the image used as a pin (resizes image)
:* <code>iconAnchor</code> - 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
:* <code>popupAnchor</code> - 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

Latest revision as of 00:36, 17 October 2024

This is a documentation subpage for Template:MapLink/Sandbox.
It contains usage information, categories, and other content that is not part of the original template page.
Template:MapLink/Sandbox invokes function maptemp in Module:Sandbox/User:Jakesterwars/Map using Lua.

Used to generate regular, square or pin maplinks. For a list of available parameters see below.

Usage

Single

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

Simple Map Pin Map
{{MapLink|2613,3294|text=Map link text}} {{MapLink|x=2613|y=3294|mtype=pin|group=pinex}}
Map link text

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 {{MapLink|2900,3000|x:2930,y:3020,desc:This is a description,title:Pin title|x:2870,y:3080,iconWikiLink:You_are_here.png,title:Image|mtype=pin|icon=redPin}}
Line {{MapLink|2900,3000|x:2930,y:3020|3000,3020|mtype=line}} Map with a line
Polygon {{MapLink|2500,3100|2500,3130|2520,3140|2540,3115|2520,3090|mtype=polygon}}
Polygon and pins {{MapLink|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
  • text - The text to show as a link instead of MapLink (used with type=maplink)
  • 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)
  • 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 maplink

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: greenPin, redPin, 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