-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from NINAnor/hierarchical-layers
Hierarchical layers
- Loading branch information
Showing
24 changed files
with
5,251 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, | ||
settings: { react: { version: '18.2' } }, | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
'react/prop-types': [ | ||
'warn', | ||
], | ||
}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
datasets/*/ | ||
!datasets/example-* | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
FROM node:18 as frontend | ||
WORKDIR /app | ||
COPY package.json package-lock.json . | ||
RUN npm i | ||
COPY src src/ | ||
COPY public public/ | ||
COPY vite.config.js index.html . | ||
|
||
CMD ["npm", "run", "dev"] | ||
|
||
FROM frontend as build | ||
RUN npm run build | ||
|
||
FROM nginx | ||
|
||
COPY nginx/default.conf.template /etc/nginx/templates/ | ||
COPY viewer.html /var/www/ | ||
COPY assets/map.js assets/style.css /var/www/assets/ | ||
|
||
COPY --from=build /app/dist /var/www/ | ||
RUN mv /var/www/index.html /var/www/viewer.html |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,32 @@ | ||
{ | ||
"style": "style.json", | ||
"source": "nina.geojson", | ||
"style": "/datasets/example-nina-offices/style.json", | ||
"subtitle": "NINA offices across Norway", | ||
"description": "<p>NINA offices across Norway. This is a test dataset.</p>" | ||
"description": "<p>NINA offices across Norway. This is a test dataset.</p>", | ||
"layers": [ | ||
{ | ||
"type": "group", | ||
"id": "id1", | ||
"name": "Test", | ||
"download": "/datasets/example-nina-offices/data.geojson", | ||
"children": [ | ||
{ | ||
"id": "id2", | ||
"name": "Foo", | ||
"children": [ | ||
{ | ||
"type": "layer", | ||
"id": "osm", | ||
"name": "osm" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "layer", | ||
"name": "data", | ||
"id": "data-layer", | ||
"download": "/datasets/example-nina-offices/data.geojson" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Viewer</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
root /var/www; | ||
absolute_redirect off; | ||
autoindex on; | ||
|
||
location = / { | ||
return 307 /datasets/; | ||
} | ||
location = /datasets/ { | ||
} | ||
|
||
location ~* ^/datasets/(.+)/$ { | ||
return 307 /viewer.html#$1; | ||
} | ||
|
||
location ~* ^/datasets/(.+)/(.+)$ { | ||
try_files $uri $uri/; | ||
} | ||
|
||
location = /viewer.html { | ||
proxy_pass http://vite:3000/index.html; | ||
} | ||
|
||
location / { | ||
proxy_pass http://vite:3000; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "Upgrade"; | ||
proxy_set_header Host $host; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} | ||
|
Oops, something went wrong.