Open tallowen opened 1 year ago
Also just to reiterate: the security concerns that led to the access control we currently have are only about our own data, not access to Mapbox or ESRI using our API tokens (both are whitelisted to AW domains so can't be stolen). Our main impetus was, and I think continues to be, to prevent someone like, say, a river outfitter turned app developer, from using our data without asking or reaching some kind of licensing agreement.
@drewalth there may be some overlap between this and what you're working on given that both tasks involve connecting some serverless architecture to our existing DB
I created an endpoint: https://tileserver.americanwhitewater.org
That hits the following code: https://github.com/AmericanWhitewater/aw-components/tree/main/js-packages/tileserver
There are a couple key things that we need to do with this code:
https://tileserver.americanwhitewater.org/ now returns data fetched by prisma and backed by the database. I believe the next step is just to add to the queries and return the correct data.
The tileserver is currently implemented by this SQL query in this Laravel controller:
https://github.com/AmericanWhitewater/wh2o/blob/development/app/Http/Controllers/API/TilesController.php
Worth noting (so that you don't bang your head against the wall) that it may require some functions that are created in PostGIS using this mapbox library. It did at one point, I'm not 100% sure now.
On the front-end, this tileserver endpoint is used anywhere we use the
VUE_APP_NWI_TILE_SERVE
environment variable. That's loaded intoenvironment.nwiTileServer
-- grepping "nwiTileServer" should get you the most up-to-date listing of where it's used. As of now, it's only actually used in thenwiMap
component (which is reused in a number of places throughout the site):https://github.com/AmericanWhitewater/wh2o-vue/blob/development/src/app/views/river-index/components/nwi-map.vue