Template:Wy/syl/Mapframe
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
{{Wy/syl/Mapframe|1|2|zoom=|height=|width=|layer=|staticmap=|align=|name=}}
Parameters
|1
latitude of the map's centre, valid range: -90.0 to 90.0|2
longitude of the map's centre, valid range: -180.0 to 180.0|zoom=
zoom level, default=14, valid range: 0 to 18 or auto (0=Earth, 18=city block, auto=showing all markers)|height=
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|width=
width of map frame in pixels, default is 420|staticmap=
static map image, a normal png or svg file|align=
alignment of map frame, default is right (other values are "left" and "center")|name=
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.|layer=
see Wy/syl/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
{{Wy/syl/Mapframe|51.47766|0.00115}}
{{Wy/syl/Mapframe|zoom=auto}} (lat/long is not required)
{{Wy/syl/Mapframe|51.47766|0.00115|zoom=14|height=400|width=400}}
{{Wy/syl/Mapframe|51.47766|0.00115|zoom=14|height=400|width=400 |layer=W|staticmap=map.png}}
{{Wy/syl/Mapframe|51.47766|0.00115|zoom=14|height=400|width=400 |layer=MLSCG|align=center|name=the Binnenstad}}
Associated template
- {{Wy/syl/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.
- {{Wy/syl/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.
- {{Wy/syl/Maplayers}} – list of maplayer names, to facilitate adding a custom layer.
Examples
{{Wy/syl/Mapframe|51.47766|0.00115}}
{{Wy/syl/Mapframe|zoom=auto}} (lat/long is not required)
{{Wy/syl/Mapframe|51.47766|0.00115|zoom=14|height=400|width=400}}
{{Wy/syl/Mapframe|51.47766|0.00115|zoom=14|height=400|width=400 |layer=W|staticmap=map.png}}
{{Mapframe|51.47766|0.00115|zoom=14|height=400|width=400 |layer=MLSCG|align=center|name=the Binnenstad}}
Associated template
ERROR: This page is using an unprefixed version of template {{Tl}}
{{Wy/syl/Tl}}
instead and replace all occurences of {{Tl}}
in Wy/syl/
prefixed pages by that.{{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.
ERROR: This page is using an unprefixed version of template {{Tl}}
{{Wy/syl/Tl}}
instead and replace all occurences of {{Tl}}
in Wy/syl/
prefixed pages by that.{{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.
ERROR: This page is using an unprefixed version of template {{Tl}}
Use {{Wy/syl/Tl}}
instead and replace all occurences of {{Tl}}
in Wy/syl/
prefixed pages by that.
{{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
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.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Latitude | 1 | Latitude of the map's centre, -90 to 90
| Number | suggested |
Longitude | 2 | Longitude of the map's centre, -180 to 180
| Number | suggested |
Zoom level | zoom | Zoom level from 0-18 (0=Earth, 18=city block, auto=fit all markers)
| Number | suggested |
Width | width | Width of map frame
| Number | optional |
Height | height | Height of map frame
| Number | optional |
Name | name | Name of the location as you want it to appear in the caption
| Unknown | optional |
Alignment | align | Alignment of the map frame, left/right/center
| String | optional |
Layer | layer | List of layers to show, see [[Wikivoyage:How to use dynamic maps#Mapframe]]
| String | optional |
Static map image | staticmap | A PNG or SVG file to serve as the static map image
| File | optional |
- Maintenance:Pages using unprefixed templates
- Maintenance:Pages using unprefixed template Tl
- Maintenance:Templates using unprefixed templates
- Maintenance:Templates using unprefixed template Tl
- Wy/syl/Pages using unprefixed templates
- Wy/syl/Pages using unprefixed template Tl
- Wy/syl/Templates using unprefixed templates
- Wy/syl/Templates using unprefixed template Tl
- Dynamic map templates