Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
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
VIPSLogic
Commits
2ef45e9c
Commit
2ef45e9c
authored
1 year ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
feature: Import of Mattilsynet's apiary site layer
feature: Legend/toggle of apiary and nursery layers
parent
0d2341dc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/webapp/map_applications/fireblight/index.html
+13
-3
13 additions, 3 deletions
src/main/webapp/map_applications/fireblight/index.html
src/main/webapp/map_applications/fireblight/js/map.js
+49
-7
49 additions, 7 deletions
src/main/webapp/map_applications/fireblight/js/map.js
with
62 additions
and
10 deletions
src/main/webapp/map_applications/fireblight/index.html
+
13
−
3
View file @
2ef45e9c
...
...
@@ -142,9 +142,9 @@
#legend
ul
li
:before
{
content
:
""
;
line-height
:
1
em
;
width
:
.7
em
;
height
:
.7
em
;
line-height
:
2
em
;
width
:
0.81
em
;
height
:
0.81
em
;
float
:
left
;
margin
:
.25em
.25em
0
;
border-radius
:
50%
;
...
...
@@ -158,6 +158,10 @@
#legend
ul
li
.paere
:before
{
background-color
:
rgb
(
122
,
175
,
131
);
}
#legend
ul
li
.plante
:before
{
background-color
:
rgb
(
0
,
0
,
255
);
}
#legend
ul
li
.apiary
:before
{
line-height
:
1em
;
width
:
.7em
;
height
:
.7em
;
}
#legend
ul
li
.apiary
:before
{
background-color
:
#ffe05e
;
}
#legend
ul
li
.nursery
:before
{
line-height
:
1em
;
width
:
.5em
;
height
:
.5em
;
border
:
3px
dotted
black
;
background-color
:
rgb
(
255
,
127
,
127
);}
/* Screen size adjustments */
@media
(
max-width
:
500px
)
{
...
...
@@ -267,6 +271,7 @@
</div>
<div
id=
"legend"
>
<h3>
Registreringer
</h3>
<ul>
<li
class=
"bulk"
>
Bulkemispel
</li>
<li
class=
"sprik"
>
Sprikemispel
</li>
...
...
@@ -275,6 +280,11 @@
<li
class=
"paere"
>
Pære
</li>
<li
class=
"plante"
>
Annet
</li>
</ul>
<h3>
Kilder til spredning
</h3>
<ul>
<li
class=
"apiary"
><input
type=
"checkbox"
checked
onclick=
"apiaryLayer.setVisible(this.checked);"
/>
Bigårdsplass
</li>
<li
class=
"nursery"
><input
type=
"checkbox"
checked
onclick=
"nurseryPoisOverlay.setVisible(this.checked);"
/>
Planteskole
</li>
</ul>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/map_applications/fireblight/js/map.js
+
49
−
7
View file @
2ef45e9c
// The globally available map objects
var
map
,
featureOverlay
,
newFeatureOverlay
,
diseaseSpreading
PoisOverlay
;
var
map
,
featureOverlay
,
newFeatureOverlay
,
nurseryPoisOverlay
,
apiaryLayer
;
//, apiary
PoisOverlay;
// Override localization settings for this particular web page
var
hardcodedLanguage
=
"
nb
"
;
...
...
@@ -171,12 +171,32 @@ async function initMap()
});
diseaseSpreading
PoisOverlay
=
new
ol
.
layer
.
Vector
({
nursery
PoisOverlay
=
new
ol
.
layer
.
Vector
({
source
:
new
ol
.
source
.
Vector
({
features
:
new
ol
.
Collection
()
}),
style
:
diseaseSpreadingPoiStyle
});
/*apiaryPoisOverlay = new ol.layer.Vector({
source: new ol.source.Vector({
features: new ol.Collection()
}),
style: diseaseSpreadingPoiStyle
});*/
let
apiarySource
=
new
ol
.
source
.
ImageWMS
({
url
:
'
https://kart.mattilsynet.no/wmscache/service
'
,
params
:
{
"
LAYERS
"
:
"
Mattilsynet_Bigaardsplasser
"
},
ratio
:
1
,
projection
:
ol
.
proj
.
get
(
"
EPSG:25833
"
)
});
apiaryLayer
=
new
ol
.
layer
.
Image
({
source
:
apiarySource
,
visible
:
true
,
opacity
:
1.0
});
map
=
new
ol
.
Map
({
target
:
'
map
'
,
...
...
@@ -184,7 +204,9 @@ async function initMap()
//topo2graatone,
topo4
,
//osm,
diseaseSpreadingPoisOverlay
,
nurseryPoisOverlay
,
//apiaryPoisOverlay,
apiaryLayer
,
featureOverlay
,
newFeatureOverlay
],
...
...
@@ -359,7 +381,8 @@ function diseaseSpreadingPoiStyle(feature, resolution)
function
getAndRenderDiseaseSpreadingPois
()
{
fetch
(
"
/rest/poi/organization/1/type/geojson?poiTypes=6,7
"
)
// Nurseries
fetch
(
"
/rest/poi/organization/1/type/geojson?poiTypes=7
"
)
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
let
olFeatures
=
(
new
ol
.
format
.
GeoJSON
()).
readFeatures
(
...
...
@@ -372,12 +395,31 @@ function getAndRenderDiseaseSpreadingPois()
//sconsole.info(olFeatures);
//console.info(diseaseSpreadingPoisOverlay.getSource());
diseaseSpreading
PoisOverlay
.
getSource
().
clear
();
diseaseSpreading
PoisOverlay
.
getSource
().
addFeatures
(
olFeatures
);
nursery
PoisOverlay
.
getSource
().
clear
();
nursery
PoisOverlay
.
getSource
().
addFeatures
(
olFeatures
);
});
/*
// Apiary sites
// 2023-10-04: Reading WMS layer directly from Mattilsynet
fetch("/rest/poi/organization/1/type/geojson?poiTypes=6")
.then(response => response.json())
.then(data => {
let olFeatures = (new ol.format.GeoJSON()).readFeatures(
data,
{
dataProjection: "EPSG:4326",
featureProjection: map.getView().getProjection().getCode()
}
);
//sconsole.info(olFeatures);
//console.info(diseaseSpreadingPoisOverlay.getSource());
apiaryPoisOverlay.getSource().clear();
apiaryPoisOverlay.getSource().addFeatures(olFeatures);
});
*/
}
/**
...
...
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