Widget:Test map
From Guild Wars 2 Wiki
Jump to navigationJump to search
This extremely lightweight widget uses Leaflet.js and nothing from the official data API; it relies on manually specified data to display markers. It does however use tiles from the render service.
This widget should only be used once per page.
Usage
{{#Widget:Test map}}
Parameters
- width
- height
- The widths and heights to use for the map frame. Do not specify the "px" suffix.
- notiles
- Optional. If set equal to "y", no tiles will be displayed.
- continent
- The continent for the tiles to be rendered for. Typically 1 for core tyria. I.e. the blue bit
https://tiles.guildwars2.com/2/3/3/6/3.jpg
- floor
- The floor for the tiles to be rendered for. Typically 0-3 for most of tyria. I.e. the purple bit
https://tiles.guildwars2.com/2/3/3/6/3.jpg
- zoom
- The initial zoom. Typically 6. I.e. the green bit
https://tiles.guildwars2.com/2/3/3/6/3.jpg
- center
- An array of coordinates to center the map around upon initial page load.
- markers
- The data to display, specified as a JSON formatted object.
- The first level keys are used as map layers.
- The first level values are an array of marker objects.
- The second level marker objects can use the following fields: coords, name, icon.
Example wikicode
1
{{#Widget:Test map
| width = 800
| height = 800
| continent = 1
| region = 7
| floor = 1
| zoom = 3
| center = [42519.2, 30530.93]
| markers = {
"Zones":
[
{ "name": "Continent 2 continent_dims", "coords": [[42519.2, 30530.93], [46231.2, 27978.93]], "notes": "Queensdale" }
],
"Sectors":
[],
"Waypoints":
[
{ "id": 2301, "coords": [44094.9, 28803.7], "name": "Shaemoor Garrison Waypoint" }
],
"Points of Interest":
[]
}
}}
2
{{#Widget:Test map
| width = 800
| height = 800
| continent = 2
| region = 3
| floor = 3
| zoom = 1
| center = [9182.4, 11994.67]
| markers = {
"Zones":
[
{ "name": "Continent 2 continent_dims", "coords": [[9182.4, 11994.67], [12286.4, 8922.67]], "notes": "Red Desert Borderland" }
],
"Sectors":
[],
"Waypoints":
[
{ "id": 2301, "coords": [10774.6, 10071.3], "name": "Red Garrison Waypoint" }
],
"Points of Interest":
[]
}
}}