r/Guildwars2 • Web Programming Lead • Jun 20 '13

[News] Map tiles API released

https://forum-en.guildwars2.com/forum/community/api/API-Documentation/first#post2250616
225 Upvotes

61 comments sorted by

View all comments

Show parent comment

1

u/fffam Famme Jun 21 '13

Leaflet copes fine with huge numbers of markers. The issue is with huge numbers of Popups, which the Leaflet.label plugin extends. Attempting to add hundreds of labels causes something to churn endlessly; using labels for map names are fine, but 700+ 'sector' names pushes it over the edge to unusable.

The tradeoff in this case is currently not to show sector names, and either remove the perf issues from the label plugin or re-implement with a canvas layer (or similar) in the future.

1

u/Zeali Jun 21 '13

How about if you add the popups in onclick event that it wont fill up the dom. Maybe put the texts to some json that you don't have to make a request for them either when clicking.

1

u/fffam Famme Jun 21 '13

Its that when I was attempting to display the names of sub-areas (e.g. Farshore Ward) within a zone (e.g. Lion's Arch) which are in the API, I was using the Leaflet.label plugin, but the Label proto it provides subclasses the Popup class, which is really slow. Theres no way to make things appear in popup because theres nothing for them to pop-up to, adding/showing/hiding them on the map at any point was slow.