Jump to content

Template:Location/doc

From translatewiki.net
This is the documentation subpage for the parent Template:Location page.
Usage:
The Location template is used on a user page for indicating their geographical location of interest. This location is used to generate maps of contributors (notably on pages describing the various supported translation projects hosted on this wiki).
If a user has indicated their preferred location of interest, either in their preferences profile or on their user page by transcluding this template (click the "Modify with a form" tab at top of the page, select the location on the map, submit to insert or update the Location template), these geographical coordinates will also be displayed (in DMS format) on that page.
The optional parameter 1 may indicate geographical coordinates anywhere on Earth (with the WGS84 reference geoid, like with GPS and on OpenStreetMap) to associate for the user.
  • Its value may be indicated:
    • either as a comma separated pair of decimal numbers (in degrees, positive for Northern latitudes and Eastern longitudes), for example: 45.999999, 120.999999 (6 digits for fractions of degrees are sufficient for decimetric precision of distances in the real world; note that the template may not work properly if the indicated precision is excessive; white spaces are allowed in the given value but ignored),
    • or in DMS format with cardinal directions, for example: 45° 59' 59.99" N, 120° 59' 59.99" E (at most 2 digits for fractions of arc-seconds are sufficient for decimetric precision of distances in the real world).
  • If there's no parameter specified, coordinates will be taken from user's preferences.
  • If coordinates are empty or invalid, or if the optional parameter |hidden= is set to a non-empty value, no box will be displayed.
  • If coordinates are empty, the user page will be tracked instead in Category:Users with no location (the template is present but has no effect and can be removed).
  • If coordinates were specified but invalid, the user page will be tracked instead Category:Users with incorrect location.
  • If the location was indicated in a subpage of a user page, that user subpage will be tracked instead in Category:User subpages with location.
  • If coordinates are correctly set on a user page, that user page will be categorized in Category:Users with location.
For privacy reason, users should avoid indicating their own very precise location, but should instead locate themselves in a public place (for example, around the center of their area of interest, such as a city or suburb with a sufficient population, or an important point of transit or meeting, preferably outside of areas with strong access restrictions ; good locations are outdoor on street or squares near municipal townhalls or post offices, or in commercial areas, airports or harbours, railway/subway stations, important bus stations, major road crossings, leisure parks, public parks and important touristic points of interest). Users are not required to indicate the exact address of their home or of their actual place of work. Users are free to change this location at any time (or to remove it if they don't want to be shown on project contributors maps; some users will just locate themselves in the middle of the ocean).
Syntax:
Parameters:
  • 1= latitude, longitude: a pair of angular coordinates separated by a comma, in decimal degrees, or in degrees, arcminutes, arcseconds (optional, if empty or invalid, removes the location and the box)
  • hidden= if set to a non-empty value, do not display any box, and all the following parameters (except coordinates) are ignored (optional, the default is empty to render the box when coordinates are valid)
  • float= position of the rendered box relative to the page, one of: left, right, none (optional, the default value is right)
  • zoom= custom zoom level to render the map: an integer between 1 and 19 (optional, the default value is 9, the map can still be zoomed in/out)
  • width= width in pixels of the rendered map (optional, 246 by default for perfect vertical alignment with "Babelboxes"; note that this does not include the additional width of the thin vertical borders and inner paddings); should only be used with float=none
  • height= height in pixels of the rendered map (optional, 200 by default; note that this does not include the additional height taken by the caption showing the location coordinates below the map, and the additional height for the thin horizontal borders and inner paddings)
  • layers= comma-separated list of map layer providers, which may be one or more of: OpenStreetMap, OpenStreetMap.HOT, OpenStreetMap.DE, OpenTopoMap... (optional the default value is OpenStreetMap). If there are several layers listed and available, there will be a layer selector added on top of the map on the upper-right corner (otherwise that selector will not be visible). Each enabled layer adds its own copyright and licencing statement at bottom of the map.
Limitations:
  • The only map service supported is "leaflet". Layers based on the "googlemap" service or needing an API key are not supported on this wiki.
  • Also you can only specify map layers that do not require any API key. Otherwise the map won't render correctly or will just render map tiles covered by warnings, or nothing significant.
  • Before changing the default layer for the map on your page, add the one you want to test to a working one, and use the layer selector in the preview to see if it behaves correctly, and has the loading performance you want.
Examples:
  • {{Location|45° 59' 59.99" N, 120° 59' 59.99" E}}
  • {{Location|45.999999, 120.999999}}
  • {{Location|45.999999, 120.999999|float=left|zoom=6|width=246|height=200|layers=OpenStreetMap,OpenStreetMap.HOT,OpenTopoMap}}
  • {{Location|45° 59' 59.99" N, 120° 59' 59.99" E|hidden=yes}}
See also: