Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSWeb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSWeb
Commits
a12d389f
Commit
a12d389f
authored
1 year ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Prepare first public test version
parent
81d21a9b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
spatial/static/spatial/js/gridmap.js
+5
-4
5 additions, 4 deletions
spatial/static/spatial/js/gridmap.js
spatial/urls.py
+1
-0
1 addition, 0 deletions
spatial/urls.py
spatial/views.py
+3
-3
3 additions, 3 deletions
spatial/views.py
with
9 additions
and
7 deletions
spatial/static/spatial/js/gridmap.js
+
5
−
4
View file @
a12d389f
...
...
@@ -29,7 +29,7 @@ async function switchLayer(dayIndex)
if
(
layers
[
i
].
getVisible
())
{
document
.
getElementById
(
"
layerLegendImg
"
).
src
=
currentLayer
.
Style
[
0
].
LegendURL
[
0
].
OnlineResource
;
console
.
info
(
currentLayer
.
Style
[
0
].
LegendURL
[
0
].
OnlineResource
);
//
console.info(currentLayer.Style[0].LegendURL[0].OnlineResource);
// Get the legend!
//let legendURL = layers[i].getSource().getLegendUrl(map.getView().getResolution());
//console.info(legendURL);
...
...
@@ -66,8 +66,9 @@ async function initGridMap(inputModelId, mapAttribution) {
// Get layers from WMS service
let
parser
=
new
ol
.
format
.
WMSCapabilities
();
//console.info(mapserverURL + modelId + "?service=WMS&version=1.3.0&request=GetCapabilities");
let
response
=
await
fetch
(
mapserverURL
+
modelId
+
"
?service=WMS&version=1.3.0&request=GetCapabilities
"
);
console
.
info
(
response
.
status
);
// Response is 200 even if a model doesn't exist on the mapserver
//
console.info(response.status); // Response is 200 even if a model doesn't exist on the mapserver
let
txt
=
await
response
.
text
();
/*
<HTML>
...
...
@@ -77,12 +78,12 @@ async function initGridMap(inputModelId, mapAttribution) {
msLoadMap(): Unable to access file. (/disks/data01/mapserver/wms/SEPTREFFUM/SEPTREFFUM.map) <=== Security issue on the mapserver!!!
</BODY></HTML>
*/
console
.
info
(
txt
);
//
console.info(txt);
let
capabilities
=
parser
.
read
(
txt
);
let
WMSLayers
=
capabilities
.
Capability
.
Layer
.
Layer
;
document
.
getElementById
(
"
modelTitle
"
).
innerHTML
=
capabilities
.
Service
.
Title
;
document
.
getElementById
(
"
modelAbstract
"
).
innerHTML
=
capabilities
.
Service
.
Abstract
.
replaceAll
(
"
\n\n
"
,
"
XXX
"
);
console
.
info
(
capabilities
);
//
console.info(capabilities);
// Analyze and organize layers
// First dimension: Time
...
...
This diff is collapsed.
Click to expand it.
spatial/urls.py
+
1
−
0
View file @
a12d389f
...
...
@@ -8,4 +8,5 @@ urlpatterns = [
re_path
(
r
'
^$
'
,
views
.
index
,
name
=
'
index
'
),
re_path
(
r
'
test/PSILARTEMP$
'
,
views
.
psilartemp
,
name
=
'
psilartemp
'
),
re_path
(
r
'
gridmap/(?P<model_id>\w+)/$
'
,
views
.
gridmap
,
name
=
'
gridmap
'
),
re_path
(
r
'
gridmap/
'
,
views
.
gridmap
,
name
=
'
gridmap
'
),
]
This diff is collapsed.
Click to expand it.
spatial/views.py
+
3
−
3
View file @
a12d389f
from
django.shortcuts
import
render
from
django.shortcuts
import
render
,
redirect
from
django.http
import
Http404
from
django.conf
import
settings
...
...
@@ -13,7 +13,7 @@ def psilartemp(request):
context
=
{}
return
render
(
request
,
'
spatial/psilartemp.html
'
,
context
)
def
gridmap
(
request
,
model_id
):
def
gridmap
(
request
,
model_id
=
None
):
try
:
for
model
in
settings
.
AVAILABLE_GRID_MODELS
:
if
model_id
==
model
[
"
model_id
"
]:
...
...
@@ -21,5 +21,5 @@ def gridmap(request, model_id):
return
render
(
request
,
'
spatial/gridmap.html
'
,
context
)
except
AttributeError
:
pass
return
index
(
request
)
return
redirect
(
"
../
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment