Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor webapp to get data from rest service #5

Open
mbjones opened this issue Feb 10, 2023 · 4 comments
Open

refactor webapp to get data from rest service #5

mbjones opened this issue Feb 10, 2023 · 4 comments
Labels
webapp Web application

Comments

@mbjones
Copy link
Contributor

mbjones commented Feb 10, 2023

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:

  • get lat/lon parameters from the application query URI
    • this would be the main mechanism if the app is linked to a separate map with a clickable UI
    • URI format would be: /static/index.html?vlat=58.3&vlong=-134.4
    • those coordinates would be passed to /wxapp/getwxvar?vlat=58.3&vlong=-134.4 to get the json file to be displayed
  • optionally enter coordinates in new editable text boxes in the web form
  • enter a city name, which would be indexed against a canonical location and returned
@mbjones mbjones added the webapp Web application label Feb 10, 2023
@mbjones
Copy link
Contributor Author

mbjones commented Sep 3, 2023

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
Copy link
Contributor Author

mbjones commented Oct 7, 2023

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
Copy link
Contributor

I like that idea. @hig314

@hig314
Copy link
Contributor

hig314 commented Oct 20, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
webapp Web application
Projects
None yet
Development

No branches or pull requests

3 participants