Demonstrates integration of DeFROST Snow Cover tiles and API in supported platforms:
- OpenLayers 5.3, Leaflet 1.5, Mapbox GL JS 1.2 and Google Maps JS API V3 for displaying snow cover tiles
- JavaScript, Python and Curl for API requests
The test web app can be launched using npm.
Setup your JWT Access and Refresh Tokens in the .env.defaults
file. You can get them from DeFROST Account Dashboard. For the Mapbox GL JS example to work, you also need to set your Mapbox access token.
# .env.deaults, safe to commit
JWT_ACCESS_TOKEN=<YourJWTAccessTokenHere>
JWT_REFRESH_TOKEN=<YourJWTRefreshTokenHere>
DEFROST_MAPS_URL=https://maps.defrost.io/{z}/{x}/{y}.png
TOKEN_REFRESH_URL=https://api.defrost.io/v1/token/refresh/
MAPBOX_TOKEN=<YourMapboxTokenHere>
When ready, install dependencies and run the app with the following commands:
npm install
npm run start:dev
This will trigger JavaScript hot bundle compilation using webpack. Once the Compiled successfully
message appears on your terminal, access the app at localhost:8080 from your browser.
The test web application demonstrates DeFROST Snow Cover tiles integration, as well as making an API request using JavaScript. For the Python and Curl API tests, launch the files directly with your Python interpreter or from your terminal.