function addWaypoints() { $.getJSON("https://api.guildwars2.com/v1/map_floor.json?continent_id=1&floor=1&lang=de", function (data) { var region, gameMap, poi; for (region in data.regions) { region = data.regions[region]; for (gameMap in region.maps) { gameMap = region.maps[gameMap]; for (poi in gameMap.points_of_interest) { poi = gameMap.points_of_interest[poi]; if (poi.type != "landmark" & poi.type != "waypoint" & poi.type != "vista") { continue; } if (poi.type == "landmark") { var poiIcon = landmarkIcon; } if (poi.type == "waypoint") { var poiIcon = waypointIcon; } if (poi.type == "vista") { var poiIcon = vistaIcon; } var waypoint = L.marker(unproject(poi.coord), { title: poi.name, icon: poiIcon }).addTo(map); waypoint._icon.style.display="none"; var chatCode = createChatCode(poi.poi_id); waypoint.bindPopup("<input class='chatCode' type='text' size='12' value='"+ chatCode +"' />"); waypoint.on("contextmenu", function() {}); waypoints.push(waypoint); } } } }); }