Before I ask my question, I want to share the ways of using the three types of coordinates in the API for those unfamiliar with it…
A standard map API coordinate is like this:
standardcoord = [16295, 14527] // Trader Forum’s Waypoint
An X and Y coordinate that can be converted to LeafletJS’ system using:
latlng = map.unproject(coord, map.getMaxZoom());
An event API coordinate is like this:
eventcoord = [9835, -17597, -86] // Shadow Behemoth
An X, Y, and Z coordinate that can be converted to a standard map API coordinate using:
cr = zone.continent_rect;
mr = zone.map_rect;
standardcoord[0] = (cr[0][0]+(cr[1][0]-cr[0][0])*(eventcoord[0]-mr[0][0])/(mr[1][0]-mr[0][0]));
standardcoord[1] = (cr[0][1]+(cr[1][1]-cr[0][1])*(1-(eventcoord[1]-mr[0][1])/(mr[1][1]-mr[0][1])));
Source. Note that the Z coordinate is discarded because the map is 2D.
A Mumble Link API coordinate is like this:
mumblecoord = [-385.71387, 93.76999, 360.89853] // WvW Sunnyhill Tower
An X, Z, and Y coordinate that can be converted to an event API coordinate using:
METERS_TO_INCHES = 39.37;
eventcoord[0] = mumblecoord[0] * METERS_TO_INCHES; // x coordinate
eventcoord[1] = mumblecoord[2] * METERS_TO_INCHES; // z becomes y coordinate
eventcoord[2] = mumblecoord[1] * METERS_TO_INCHES; // y becomes z coordinate
My question is basically to get the Z coordinate for standard map API:
standardcoord[0] = (cr[0][0]+(cr[1][0]-cr[0][0])*(eventcoord[0]-mr[0][0])/(mr[1][0]-mr[0][0]));
standardcoord[1] = (cr[0][1]+(cr[1][1]-cr[0][1])*(1-(eventcoord[1]-mr[0][1])/(mr[1][1]-mr[0][1])));
standardcoord[2] = ??? // What is the equation?
If you look in the v2/wvw/objectives API, the objectives use the standard map API coordinate, but also has a Z coordinate; Sunnyhill Tower is [6276, 12718, -3758] So even though the map icons are intended to be shown on a 2D map, Anet also allows them to be depicted with elevation.