Toggle search
Search
Toggle menu
notifications
Toggle personal menu
Editing
Template:Mapframe/doc
Template page
Views
Read
Edit
View history
associated-pages
Template
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} __NOTOC__ __NOEDITSECTION__ <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> ===Function=== This template acts as a frame for an external map. Javascript is used to replace "mapdiv" with an iframe. See [[Wikivoyage:How to use dynamic maps]] and [[Wikivoyage:Dynamic maps Expedition]] for more information. ===Usage=== : <syntaxhighlight lang="wikitext" inline>{{Mapframe|1|2|zoom=|height=|width=|layer=|staticmap=|align=|name=}}</syntaxhighlight> ====Parameters==== : <code> |1 </code> latitude of the map's centre, valid range: -90.0 to 90.0 : <code> |2 </code> longitude of the map's centre, valid range: -180.0 to 180.0 : <code> |zoom= </code> zoom level, default=14, valid range: 0 to 18 or auto (0=Earth, 18=city block, auto=showing all markers) : <code> |height= </code> height of map frame in pixels, default is 420 and it should be at least 370 to provide enough space for the layers menu to expand : <code> |width= </code> width of map frame in pixels, default is 420 : <code> |staticmap= </code> static map image, a normal png or svg file : <code> |align= </code> alignment of map frame, default is right (other values are "left" and "center") : <code> |name= </code> name of the location as you want it to appear in the caption; the default display is the article title with parent page and disambiguation removed. For an example of this parameter's usage, see [[Amsterdam/Binnenstad]]. : <code> |layer= </code> see [[Wikivoyage:How to use dynamic maps#Mapframe]] If the coordinates are not given, they and the zoom will be deduced from the markers and the possible mapshapes etc. to be shown. This works well in some cases, but can give a strange result in others (such as if there is an airport far from a city to be shown). ===Examples=== <syntaxhighlight lang="wikitext" style="white-space: pre-wrap;"> {{Mapframe|51.47766|0.00115}}</syntaxhighlight> <syntaxhighlight lang="wikitext" style="white-space: pre-wrap;"> {{Mapframe|zoom=auto}} (lat/long is not required)</syntaxhighlight> <syntaxhighlight lang="wikitext" style="white-space: pre-wrap;"> {{Mapframe|51.47766|0.00115|zoom=14|height=400|width=400}}</syntaxhighlight> <syntaxhighlight lang="wikitext" style="white-space: pre-wrap;"> {{Mapframe|51.47766|0.00115|zoom=14|height=400|width=400 |layer=W|staticmap=map.png}}</syntaxhighlight> <syntaxhighlight lang="wikitext" style="white-space: pre-wrap;"> {{Mapframe|51.47766|0.00115|zoom=14|height=400|width=400 |layer=MLSCG|align=center|name=the Binnenstad}}</syntaxhighlight> ===Associated template=== * {{tl|mapshape}} β used to create a mask, shape or line using data from the OpenStreetMap database; useful for city or region borders, or for showing routes. * {{tl|mapmask}} β used to create a mask using manually entered latitude/longitude pairs; useful for drawing city or region borders that aren't available from OpenStreetMap. * {{tl|maplayers}} β list of maplayer names, to facilitate adding a custom layer. ===Code=== * [[Module:Map]] used to create <mapframe> tag with all of the parameters ---- ===Template Data=== <templatedata> { "params": { "1": { "label": "Latitude", "description": "Latitude of the map's centre, -90 to 90", "type": "number", "example": "51.47766", "suggested": true }, "2": { "label": "Longitude", "description": "Longitude of the map's centre, -180 to 180", "example": "0.00115", "type": "number", "suggested": true }, "zoom": { "label": "Zoom level", "description": "Zoom level from 0-18 (0=Earth, 18=city block, auto=fit all markers)", "example": "14", "type": "number", "suggested": true }, "align": { "label": "Alignment", "description": "Alignment of the map frame, left/right/center", "example": "center", "type": "string", "default": "right", "suggestedvalues": ["left","right","center"] }, "name": { "label": "Name", "description": "Name of the location as you want it to appear in the caption", "default": "Article title", "example": "the Binnenstad" }, "staticmap": { "label": "Static map image", "description": "A PNG or SVG file to serve as the static map image", "example": "map.png", "type": "wiki-file-name" }, "width": { "label": "Width", "description": "Width of map frame", "example": "400", "type": "number", "default": "420" }, "height": { "label": "Height", "description": "Height of map frame", "example": "400", "type": "number", "default": "420" }, "layer": { "label": "Layer", "description": "List of layers to show, see [[Wikivoyage:How to use dynamic maps#Mapframe]]", "example": "MLSCG", "type": "string" } }, "paramOrder": [ "1", "2", "zoom", "width", "height", "name", "align", "layer", "staticmap" ], "description": "This template acts as a frame for an external map. Javascript is used to replace \"mapdiv\" with an iframe. See [[Wikivoyage:How to use dynamic maps]] and [[Wikivoyage:Dynamic maps Expedition]] for more information.", "format": "inline" } </templatedata> <includeonly> <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> [[Category:Dynamic map templates]] </includeonly>
Summary:
Please note that all contributions to Dive Atlas may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Meta:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Documentation subpage
(
edit
)
Template:Mapframe
(
edit
)
Template:Maplayers
(
edit
)
Template:Maplink
(
edit
)
Template:Ombox
(
edit
)
Template:Tl
(
edit
)
Module:Arguments
(
edit
)
Module:Map
(
edit
)