FANDOM


Transforms a user Map POI, point of interest, based on current map settings defined by Map/Extents, to a linear normalized point useful in the browser DOM. This template is used by other Map templates and is not normally used directly, but it can be. See Template:Map/Extents and Template:Map.

Usage
  • 1 - x user map coordinate
  • 2 - y user map coordinate
Returns: nothing or empty
Sets variables: 'pointLeft' and 'pointTop' with scaled x and y useful for browser DOM. Assumes the extents variables from Map/Extents have already been set-up correctly. Are scaled from 0.0 to 100.0 and suitable for use with CSS 'left' and 'top' position attributes.
Examples
Get scaled point for map coordinate 23,45 for a map that's 200 x 200
{{Map/Extents|0|0|200|200}}
{{Map/Point|23|45}}
{{#var:pointLeft}} {{#var:pointTop}}
{{Map/Extents|clear=1}}

11.5 22.5

Get scaled point for extents with a virtual center at 50,50
{{Map/Extents|0|0|200|200|150|150}}
{{Map/Point|23|45}}
{{#var:pointLeft}} {{#var:pointTop}}
{{Map/Extents|clear=1}}

7.6666666666667 15

Get scaled point for extents with a virtual center at 50,50
{{Map/Extents|-180|0|45|-85|-65|-65}}
{{Map/Point|-72.202|-67.136}}
{{#var:pointLeft}} {{#var:pointTop}}
{{Map/Extents|clear=1}}

75 75


For Admins and Maintainers

This template can be edited to support any type of coordinate system or mapping system. This template effectively generates the initial POI static placement values for each POI for each map. The JS code has code that mirrors these transforms for it's uses, for both projection and un-projection. If this template is edited in away that actually changes the scale or actual numerical output for points, then the MediaWiki:Map/code.js will also need to be changed to mirror and make available the same transforms.


Community content is available under CC-BY-SA unless otherwise noted.