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
941aa9ea
Commit
941aa9ea
authored
9 months ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
feat: Fix dynamic urls to mapModal
parent
cddf95c2
No related branches found
No related tags found
1 merge request
!22
Update rognebærmøll
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applefruitmoth/templates/applefruitmoth/index.html
+23
-8
23 additions, 8 deletions
applefruitmoth/templates/applefruitmoth/index.html
with
23 additions
and
8 deletions
applefruitmoth/templates/applefruitmoth/index.html
+
23
−
8
View file @
941aa9ea
...
@@ -45,6 +45,8 @@
...
@@ -45,6 +45,8 @@
});
});
</script>
</script>
<script
type=
"module"
>
<script
type=
"module"
>
const
modulePath
=
`
${
settings
.
vipslogicProtocol
}
://
${
settings
.
vipslogicServerName
}
/js/mapModal.js`
;
import
MapModal
from
'
https://logic.testvips.nibio.no/js/mapModal.js
'
;
import
MapModal
from
'
https://logic.testvips.nibio.no/js/mapModal.js
'
;
const
selectWeatherstationElement
=
document
.
getElementById
(
"
weatherStationId
"
);
const
selectWeatherstationElement
=
document
.
getElementById
(
"
weatherStationId
"
);
...
@@ -154,7 +156,7 @@
...
@@ -154,7 +156,7 @@
window
.
openCoordinatesMap
=
()
=>
{
window
.
openCoordinatesMap
=
()
=>
{
if
(
inputLatitudeElement
.
value
&&
inputLongitudeElement
.
value
)
{
if
(
inputLatitudeElement
.
value
&&
inputLongitudeElement
.
value
)
{
selectedPoint
=
1
;
selectedPoint
=
-
1
;
selectedFeature
=
{
selectedFeature
=
{
"
type
"
:
"
FeatureCollection
"
,
"
features
"
:
[
"
type
"
:
"
FeatureCollection
"
,
"
features
"
:
[
{
{
...
@@ -175,8 +177,15 @@
...
@@ -175,8 +177,15 @@
const
isPoiMap
=
false
;
// Map should enable selection of coordinates (not pois)
const
isPoiMap
=
false
;
// Map should enable selection of coordinates (not pois)
const
allowNewPoints
=
true
;
// User should be able to select new pois
const
allowNewPoints
=
true
;
// User should be able to select new pois
const
coordinatesMapInstance
=
new
MapModal
(
'
coordinates-map
'
,
selectedFeature
,
'
nb
'
,
isPoiMap
,
allowNewPoints
,
selectCoordinates
);
coordinatesMapInstance
.
openModal
(
selectedPoint
);
import
(
modulePath
).
then
((
module
)
=>
{
const
MapModal
=
module
.
default
;
const
coordinatesMapInstance
=
new
MapModal
(
'
coordinates-map
'
,
selectedFeature
,
'
nb
'
,
isPoiMap
,
allowNewPoints
,
selectCoordinates
);
coordinatesMapInstance
.
openModal
(
selectedPoint
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
Error loading module MapModal for coordinatesMap
'
,
error
);
});
}
}
function
selectPoi
(
poiData
)
function
selectPoi
(
poiData
)
...
@@ -209,9 +218,15 @@
...
@@ -209,9 +218,15 @@
geoJson
[
"
features
"
]
=
filteredFeatures
;
geoJson
[
"
features
"
]
=
filteredFeatures
;
const
isPoiMap
=
true
;
// Map should enable selection of pois
const
isPoiMap
=
true
;
// Map should enable selection of pois
const
allowNewPoints
=
false
;
// User should not be able to create new pois
const
allowNewPoints
=
false
;
// User should not be able to create new pois
const
poiMapInstance
=
new
MapModal
(
'
poi-map
'
,
geoJson
,
'
nb
'
,
isPoiMap
,
allowNewPoints
,
selectPoi
);
const
selectedPoiId
=
applefruitMoth
.
getSelectedWeatherstation
();
import
(
modulePath
).
then
((
module
)
=>
{
poiMapInstance
.
openModal
(
selectedPoiId
);
const
MapModal
=
module
.
default
;
const
poiMapInstance
=
new
MapModal
(
'
poi-map
'
,
geoJson
,
'
nb
'
,
isPoiMap
,
allowNewPoints
,
selectPoi
);
const
selectedPoiId
=
applefruitMoth
.
getSelectedWeatherstation
();
poiMapInstance
.
openModal
(
selectedPoiId
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
Error loading module MapModal for poiMap
'
,
error
);
});
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
console
.
error
(
'
Unable to retrieve weatherstation geojson
'
,
error
);
console
.
error
(
'
Unable to retrieve weatherstation geojson
'
,
error
);
...
@@ -382,8 +397,8 @@
...
@@ -382,8 +397,8 @@
<!--[if lte IE 9]>
<!--[if lte IE 9]>
<style type="text/css">#oldIEWarning{display: block !important;}</style>
<style type="text/css">#oldIEWarning{display: block !important;}</style>
<![endif]-->
<![endif]-->
<link
type=
"text/css"
rel=
"stylesheet"
href=
"
https://logic.testvips.nibio.no
/css/3rdparty/leaflet.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"
{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}
/css/3rdparty/leaflet.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"
https://logic.testvips.nibio.no
/css/mapModal.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"
{{settings.VIPSLOGIC_PROTOCOL}}://{{settings.VIPSLOGIC_SERVER_NAME}}
/css/mapModal.css"
/>
<link
rel=
"stylesheet"
href=
"{% static "
css
/3
rdparty
/
ol.css
"
%}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static "
css
/3
rdparty
/
ol.css
"
%}"
type=
"text/css"
>
<style>
<style>
...
...
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