Showing Posts For datinc.7584:

LFM testers for an iPhone app

in Players Helping Players

Posted by: datinc.7584

datinc.7584

I am making an iPhone app for GW2. It will be going live in a few weeks and I would love some feedback. The main purpose of the app is to send you push notifications for a state change for any dynamic event in the game (Like when the shatterer has landed). If you are interested I am using TestFlight for sending out builds. Please use the link http://tflig.ht/1d1a2JB to register if you are interested.

Plotting events on a map

in API Development

Posted by: datinc.7584

datinc.7584

Thanks for the fast replies. It works perfectly now. Silly minus 1. I am not sure why they did that unless it is to cause developers sleepless nights.

Plotting events on a map

in API Development

Posted by: datinc.7584

datinc.7584

I am trying to use the event_details to plot events on the world map. The issue the x,y,z returned in the event_details.json API is in map coordinates (I am guessing) and to plot them I need them in continent coordinates. To achieve this I get the details from maps.json which has map_rect and continent_rect. I am obviously doing something wrong because my events don’t plot correctly.

Using the shatterer as an example: event_details.json and maps.json

My math looks like:



map_width = map_rect[1][0] - map_rect[0][0]; 
map_height = map_rect[1][1] - map_rect[0][1];

continent_width = continent_rect[1][0] - continent_rect[0][0]; 
continent_height = continent_rect[1][1] - continent_rect[0][1];

xMap = (event_location["center"][0] - map_rect[0][0])/map_width;
yMap = (event_location["center"][1] - map_rect[0][1] )/map_height;

xContinent = continent_rect[0][0] + xMap * continent_width;
yContinent = continent_rect[0][1] + yMap * continent_height;

: xContinent = 29753.250000
: yContinent = 15739.083008

This gets me near the bottom of the map! Am I doing it wrong or is there a better way to get the continent coordinate for an event?

Here is a fiddle so you can see the math in action

THE FIX:
yMap = 1 – yMap;

(edited by datinc.7584)

[API Suggestion] Event API Changes

in API Development

Posted by: datinc.7584

datinc.7584

For API /v1/events.json it would be nice if event_id could accept a list of event ids.