howweirdistheweather / weather_app

2 stars 0 forks source link

refactor webapp to get data from rest service #5

Open mbjones opened 1 year ago

mbjones commented 1 year ago

The current webapp hardcodes the data file to Seldovia.json. Instead, need to refactor the webapp to retrieve the data file from the /wxapp/getwxvar service as described in issue #4. Currently, this service is called without location parameters (lat and lon) on lines 95-99 of wxgrid.js, which depends on the hardcoded Seldovia response. In the refactor, we might enable several ways to pick a location:

mbjones commented 1 year ago

I see that john refactored the app to take a lat/lon on the wxapp endpoint as:

/wxapp/getwxvar?lat=58.3&lon=-134.4

This should allow the app to work with a URL such as https://hwitw-dev.arcticdata.io/static/index.html?lat=58.3&lon=-134.4

Currently that puts up an error because the hwitw.wxdb file has not yet been produced. Test again once tiletool completes its first pass.

mbjones commented 11 months ago

This is now working to load the application with URLs of the form:

https://hwitw-dev.arcticdata.io/static/index.html?lat=58.3&lon=-134.4

However, loading the app without the lat/lon params results in a blank screen and a console error. Maybe it would be better to load Seldovia or some default if the params are not provided.

jamcinnes2 commented 10 months ago

I like that idea. @hig314

hig314 commented 10 months ago

Sounds good to me - Seldovia is obviously the center of the universe and should be the default location for everything.

I'll touch base with Katmai.