Huge update! So after investigating, it looked like we were going about the whole mapbox thing in a very suboptimal way. Instead of uploading data about airports to mapbox studio and filtering that during runtime using the flights we receive from the api, now we dynamically set the data at runtime and update it according to the api response.
Why is this necessary? Two reasons:
Part of what was slowing us down before was having to loop through the entire api response and performing a variety of checks on the data to filter it. Now we just put the entire response into the map data and leverage the mapbox filter feature to do the work for us. Changing the filters is now super smooth and responsive!
Since we were uploading the data to mapbox studio beforehand, it meant that we couldn't dynamically change the styles (because the data doesn't have flight price info). Now we construct our own custom geojson with whatever info we want in it.
The only down side to this is that we can't use mapbox studio anymore to change styles, but we have a lot more control this way.
Huge update! So after investigating, it looked like we were going about the whole mapbox thing in a very suboptimal way. Instead of uploading data about airports to mapbox studio and filtering that during runtime using the flights we receive from the api, now we dynamically set the data at runtime and update it according to the api response.
Why is this necessary? Two reasons:
The only down side to this is that we can't use mapbox studio anymore to change styles, but we have a lot more control this way.