Add'l Details on /map endpoint, bounding_box param?

Hey all!

I’m trying to write a short Python script to plot some of my recent flight routes on a common map. It’s just a personal project - I think it’d be fun to see all the routes of a recent trip on a map together!

I figured the easiest way to do this would be to poll multiple routes from the ./map endpoint with a common viewport, and just turn all layers off on all but one map so that I can lay them on top of one another.

However, I’m experiencing some weird behavior in trying to set the bounding_box param. It looks like there’s some additional logic - enforcing certain views, or certain aspect ratios, or something - that’s not detailed in the documentation.

To illustrate, the same screenshot is shown for either of the coordinate inputs below
(despite the documentation citing that the param inputs are top, right, bottom, left in order)

[70, 50, 0, 120] || [70, 120, 0, 50]
image

Overall I think there’s something going on with attempting to force it into 640x480, but there’s also some kind of hidden priority of views, or something. I’ve seen it lay up both trans-Pacific and trans-Atlantic flights, so I don’t think the issue is that the map ‘ends’ at -180 degrees; rather, it looks like two of the coordinates ‘anchor’ the image and the other two then are just used to zoom the 4:3 viewport. Even still, it also seems that there is some latitude somewhere that the map simply refuses to cross.

(in the worst case, I can probably just get the paths and lay them up manually, but it’d be nice to have this fully automated :grin:)

I think this looks like the default mapJS colors? Perhaps this is that, and that’s a thread to run down? let me know if you have any advice!

If you have complex mapping needs (particularly using custom bounding boxes while trying to overlap multiple flights on a single map), you are probably going to get better results if you retrieve all of the points for each flight and plot them yourself.

You can use GET /flights/id/track to retrieve the track positions of each of the flights you want and then choose your own mapping software choice (Google Maps API, for example). Other aspects of the flight (such as depicting markers for the origin and destination airport) will also need to be drawn by yourself.