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
49e27836
Commit
49e27836
authored
8 months ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
feat: Selected coordinate should be displayed in a form when map is opened
parent
7eed3cad
No related branches found
No related tags found
1 merge request
!191
Add map module and Open-Meteo support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/webapp/js/mapModal.js
+20
-2
20 additions, 2 deletions
src/main/webapp/js/mapModal.js
with
20 additions
and
2 deletions
src/main/webapp/js/mapModal.js
+
20
−
2
View file @
49e27836
...
@@ -9,7 +9,8 @@ import {
...
@@ -9,7 +9,8 @@ import {
GeoJSON
,
GeoJSON
,
DomEvent
,
DomEvent
,
Control
,
Control
,
DomUtil
DomUtil
,
latLng
}
from
'
/js/3rdparty/leaflet-src.esm.js
'
;
}
from
'
/js/3rdparty/leaflet-src.esm.js
'
;
/**
/**
...
@@ -505,10 +506,27 @@ class MapModal {
...
@@ -505,10 +506,27 @@ class MapModal {
this
.
mapModalElement
.
style
.
alignItems
=
'
center
'
;
this
.
mapModalElement
.
style
.
alignItems
=
'
center
'
;
this
.
initMap
(
latitude
,
longitude
,
zoomLevel
);
this
.
initMap
(
latitude
,
longitude
,
zoomLevel
);
if
(
selectedPointOfInterestId
)
{
if
(
selectedPointOfInterestId
)
{
this
.
selectPointById
(
selectedPointOfInterestId
);
// Id -1 is used if the map should display the single given point as selected, with a form to enable lat/lng modification
if
(
selectedPointOfInterestId
===
-
1
)
{
const
layer
=
this
.
getLayerById
(
selectedPointOfInterestId
)
const
feature
=
this
.
getFeatureById
(
selectedPointOfInterestId
)
this
.
map
.
removeLayer
(
layer
);
this
.
simulateMapClick
(
this
.
map
,
feature
.
geometry
.
coordinates
[
1
],
feature
.
geometry
.
coordinates
[
0
])
}
else
{
this
.
selectPointById
(
selectedPointOfInterestId
);
}
}
}
}
}
simulateMapClick
(
map
,
lat
,
lng
)
{
const
clickEvent
=
{
latlng
:
latLng
(
lat
,
lng
),
layerPoint
:
map
.
latLngToLayerPoint
(
latLng
(
lat
,
lng
)),
containerPoint
:
map
.
latLngToContainerPoint
(
latLng
(
lat
,
lng
))
};
map
.
fire
(
'
click
'
,
clickEvent
);
}
/**
/**
* Hide modal. Remove container element and map.
* Hide modal. Remove container element and map.
*/
*/
...
...
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