Ice of Dragons.1637:

Is there a way to create a guild wars map from the api.
I read somewhere that gw2 api supports google map -like
maps. does the map api below return only names and cordinates or
resources to ? Where can i get more resources like icons and map peaces ?

Map information
continents: Returns a list of continents and information about each continent.
maps: Returns a list of maps in the game.
map_floor: Returns detailed information about a map floor

smiley.1438:

There are tons of examples around and also the API documentation – it’s the best way to get started

http://wiki.guildwars2.com/wiki/API:Main

A simple Google maps example:

https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2maps-gmaps-simple.html (demo)

For more advanced stuff, just have a look at my GitHub repo, the Wiki maps widget or the other examples listed on the official wiki.

Ice of Dragons.1637:

thank you for a lot of great links really helpful

if i use this https://tiles.guildwars2.com/{continent_id}/{floor}/{z}/{x}/{y}.jpg

i know where to get continent_id flor
the x and y i gues are from the map_floor but they dont seem to work
where do i get z ? or is z yust how much is it zomed ?

thank you

smiley.1438:

x and y are not the pixel coordinates but the tile coordinates. z is the desired zoom level of the requested tile.

See: http://leafletjs.com/reference.html#tilelayer or https://developers.google.com/maps/documentation/javascript/reference#ImageMapTypeOptions

Ice of Dragons.1637:

thank you sooo much really helped a loooooot

Ice of Dragons.1637:

still got nothing. i used this https://tiles.guildwars2.com/{1}/{1}/{0}/{19456}/{14976}.jpg
should be shiver peaks. Can i get a tile directly from my browser like other apis or do i need to use google map ?

Dr Ishmael.9685:

Omit the braces, that’s the first problem. The second is that I think you’re trying to use map/continent coordinates, which equate to pixels at the highest zoom level. You need to use tile coordinates, which start at [0,0] and define the individual tile image’s position at the given zoom level. Third, the lowest zoom level is 1, not 0.

https://tiles.guildwars2.com/1/1/1/0/0.jpg
https://tiles.guildwars2.com/1/1/1/0/1.jpg
https://tiles.guildwars2.com/1/1/1/1/0.jpg
https://tiles.guildwars2.com/1/1/1/1/1.jpg

Take a look at Smiley’s code to see how to handle this.

smiley.1438:

Third, the lowest zoom level is 1, not 0.

No, it’s really 0, which is 1 tile with the whole map, zoom 1 is already 2×2 tiles, because 2^0 = pow(2,0) = (1 << 0) = 1…

https://tiles.guildwars2.com/1/1/0/0/0.jpg
https://tiles.guildwars2.com/2/1/0/0/0.jpg

Try something like this (php):


$zoom = 0;
$tiles = [];

for($y = 0; $y < (1 << $zoom); $y++){
	echo '<div style="white-space: nowrap; width: '.((1 << $zoom)*256).'px;">'."\n";
	for($x = 0; $x < (1 << $zoom); $x++){
		if($x >= 0 && $y >= 0 && $x < (1 << $zoom) && $y < (1 << $zoom)){
			echo '<img src="https://tiles.guildwars2.com/1/1/'.$zoom.'/'.$x.'/'.$y.'.jpg" />';
			$tiles[$y][$x] = 'https://tiles.guildwars2.com/1/1/'.$zoom.'/'.$x.'/'.$y.'.jpg';
		}
	}
	echo '</div>'."\n";
}

print_r($tiles);

In other words: https://twitter.com/ProgrammingCom/status/312391036087451648

Ice of Dragons.1637:

this is amazing thank you for you help guys