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
0c13a4a6
Commit
0c13a4a6
authored
2 years ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
feat: Add map for tomorrow, currently displaying the same layer
parent
720ed732
No related branches found
No related tags found
1 merge request
!12
feat: Add test page (spatial) with mapserver layer in openlayers map
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spatial/static/spatial/js/spatialMap.js
+2
-2
2 additions, 2 deletions
spatial/static/spatial/js/spatialMap.js
spatial/templates/spatial/index.html
+5
-4
5 additions, 4 deletions
spatial/templates/spatial/index.html
with
7 additions
and
6 deletions
spatial/static/spatial/js/spatialMap.js
+
2
−
2
View file @
0c13a4a6
...
@@ -34,7 +34,7 @@ var carrotLayer;
...
@@ -34,7 +34,7 @@ var carrotLayer;
* @param {int} zoom - the zoom level (1-15, 1 is world wide view, 15 is greatest zoom)
* @param {int} zoom - the zoom level (1-15, 1 is world wide view, 15 is greatest zoom)
* @param {string} mapAttribution - The text in the corner of the map giving credits where it's due
* @param {string} mapAttribution - The text in the corner of the map giving credits where it's due
*/
*/
function
initSpatialMap
(
lonLat
,
zoomLevel
,
mapAttribution
)
{
function
initSpatialMap
(
lonLat
,
zoomLevel
,
mapAttribution
,
mapId
)
{
// ---------- Background layer is OpenStreetMap --------------
// ---------- Background layer is OpenStreetMap --------------
var
backgroundLayer
=
new
ol
.
layer
.
Tile
({
var
backgroundLayer
=
new
ol
.
layer
.
Tile
({
...
@@ -69,7 +69,7 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution) {
...
@@ -69,7 +69,7 @@ function initSpatialMap(lonLat, zoomLevel, mapAttribution) {
// Creating the map
// Creating the map
map
=
new
ol
.
Map
({
map
=
new
ol
.
Map
({
target
:
'
map
'
,
target
:
map
Id
,
layers
:
[
backgroundLayer
,
carrotLayer
],
layers
:
[
backgroundLayer
,
carrotLayer
],
renderer
:
'
canvas
'
renderer
:
'
canvas
'
});
});
...
...
This diff is collapsed.
Click to expand it.
spatial/templates/spatial/index.html
+
5
−
4
View file @
0c13a4a6
...
@@ -38,16 +38,17 @@
...
@@ -38,16 +38,17 @@
var
longitude
=
{{
settings
.
MAP_CENTER_LONGITUDE
|
unlocalize
}};
var
longitude
=
{{
settings
.
MAP_CENTER_LONGITUDE
|
unlocalize
}};
var
latitude
=
{{
settings
.
MAP_CENTER_LATITUDE
|
unlocalize
}};
var
latitude
=
{{
settings
.
MAP_CENTER_LATITUDE
|
unlocalize
}};
var
zoomLevel
=
{{
settings
.
MAP_ZOOMLEVEL
}};
var
zoomLevel
=
{{
settings
.
MAP_ZOOMLEVEL
}};
initSpatialMap
([
longitude
,
latitude
],
zoomLevel
,
"
{{settings.MAP_ATTRIBUTION|safe}}
"
);
initSpatialMap
([
longitude
,
latitude
],
zoomLevel
,
"
{{settings.MAP_ATTRIBUTION|safe}}
"
,
'
mapToday
'
);
initSpatialMap
([
longitude
,
latitude
],
zoomLevel
,
"
{{settings.MAP_ATTRIBUTION|safe}}
"
,
'
mapTomorrow
'
);
});
});
</script>
</script>
{% endblock %}
{% endblock %}
{% block content %}
{% block content %}
<div
class=
"row"
id=
"mapAndForecastRow"
>
<div
class=
"row"
id=
"mapAndForecastRow"
>
<!-- Start map container -->
<!-- Start map container -->
<div
class=
"col-md-
8
"
id=
"mapContainer"
>
<div
class=
"col-md-
12
"
id=
"mapContainer"
>
<div
id=
"map"
class=
"map"
style=
"height: {{settings.MAP_HEIGHT}}px;"
>
<div
class=
"col-md-6"
id=
"map
Today
"
class=
"map"
style=
"height: {{settings.MAP_HEIGHT}}px;"
>
Today
</div>
</div>
<div
class=
"col-md-6"
id=
"mapTomorrow"
class=
"map"
style=
"height: {{settings.MAP_HEIGHT}}px;"
>
Tomorrow
</div>
</div>
<!-- End map container -->
</div>
<!-- End map container -->
</div>
<!-- End row with sidebar and contents container -->
</div>
<!-- End row with sidebar and contents container -->
{% endblock %}
{% endblock %}
\ No newline at end of file
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