Widget:Karte v2

Aus Guild Wars 2 Wiki
Zur Navigation springen Zur Suche springen

Yet another API driven map widget

(description coming soon™)

Parameters

Common

lang
display/API language (0=de, 1=en, 2=es, 3=fr, 4=zh), default: 0
controls
(bool), toggles the map controls, default: 0
zoom
(int), sets the initial zoom level for the map, default: 3
center_coords (2 comma separated integers)
sets the initial center position for the map (optional)

Map selection

continent_id
API ID of the continent (1=Tyria, 2=The Mists), default: 1
floor_id
floor ID to use, default: 1
region_id
region ID (optional)
map_id
ID of the map, only in conjunction with region_id (optional)

Misc

polyline
collection of coordinates to draw a path (tba)
markers
collection of coordinates to set markers (tba)

Example

Template code

{{#Widget:Karte v2|region_id=4|map_id=15|zoom=3}}

Generated HTML

<div class="gw2map-v2" data-continent_id="1" data-floor_id="1" data-region_id="4" data-map_id="15" data-center-coords="" data-zoom="3" data-language="1" data-controls="1" data-markers="" data-polyline=""></div>

Live

Used subpages

Known problems

Please don't bother me about these:

Icons make zone names hard to read.
And that is good the way it is. It'd be possible to "lift" the text on top via the z-index css property but it would defeat the purpose of the icons by making them unclickable.
I only see a part of the map although it would fit the container as a whole on a lower zoom level.
Getting the right zoom level is a very tricky task. leaflet.js sets it automatically from the given viewport/container size and the bounding box of the map (usually continent_rect) on a zoom level as high as possible. Since the maps are all different in size, it's impossible to just set zoom level X.
Some lines of the sector boundaries are crossing.
This is completely API/game data related. Rounding errors, careless mappers etc. Please complain to Anet, not me, about this.
I don't see a map. Like... not at all.
Do you have an adblocker or scriptblocker enabled? If so, disable it for the wiki and the following domains: