Widget:Mapa

De Guild Wars 2 Wiki
Ir a la navegaciónIr a la búsqueda

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: 1
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, positive 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:Mapa|region_id=4|map_id=15|zoom=3}}

Generated HTML

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

Live

https://cdn.rawgit.com/GW2Wiki/widget-map-floors/master/examples/example.html

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:

API issues affecting the map

Example
{{Interactive map|zoom=3|linkbox=1|events=1|continent_id=1|floor_id=1|region_id=-1|include_maps=17,20,21,22,23,24,25,27,29,30,31,32,39,53,54,873|custom_rect=[[5120,7680],[32768,24576]]|extra_layers=diving_goggles,guild_bounty|init_layers=diving_goggles,map_label,guild_bounty}}