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
057e983d
Commit
057e983d
authored
7 months ago
by
Lene Wasskog
Browse files
Options
Downloads
Patches
Plain Diff
feat: Filter out points which can/should not be displayed
parent
67826e29
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
+7
-5
7 additions, 5 deletions
src/main/webapp/js/mapModal.js
with
7 additions
and
5 deletions
src/main/webapp/js/mapModal.js
+
7
−
5
View file @
057e983d
...
...
@@ -90,11 +90,10 @@ class MapModal {
this
.
mapContainerId
=
mapModalId
+
"
-container
"
;
this
.
mapContainerElement
=
this
.
addMapContainer
(
this
.
mapModalElement
,
this
.
mapContainerId
);
// The variable below should instead be: this.selectPoi or this.selectCoordinates
//
this.includeTypeInformation = Object.keys(typeNameMap).length === 7;
this
.
includeTypeInformation
=
true
;
this
.
geoJsonData
=
geoJsonData
&&
geoJsonData
!==
"
{}
"
?
geoJsonData
:
{
features
:
[]};
//
Filter out invalid features
this
.
geoJsonData
.
features
=
this
.
geoJsonData
.
features
.
filter
(
feature
=>
feature
.
geometry
.
type
===
"
Point
"
&&
!
isNaN
(
feature
.
geometry
.
coordinates
[
0
])
&&
!
isNaN
(
feature
.
geometry
.
coordinates
[
1
]))
;
this
.
geoJsonData
=
geoJsonData
;
if
(
language
in
MapModal
.
TRANSLATIONS
)
{
this
.
translations
=
MapModal
.
TRANSLATIONS
[
language
];
}
else
{
...
...
@@ -188,7 +187,6 @@ class MapModal {
// Add points to the map if given
if
(
this
.
geoJsonData
&&
this
.
geoJsonData
.
features
)
{
geoJSON
(
this
.
geoJsonData
,
{
filter
:
(
feature
)
=>
feature
.
geometry
.
type
===
"
Point
"
,
pointToLayer
:
(
feature
,
latlng
)
=>
{
return
circleMarker
(
latlng
,
this
.
styleOfPointMarker
(
feature
.
properties
.
pointOfInterestTypeId
));
},
...
...
@@ -242,6 +240,10 @@ class MapModal {
selectPointById
(
pointOfInterestId
)
{
const
selectedFeature
=
this
.
getFeatureById
(
pointOfInterestId
);
const
selectedLayer
=
this
.
getLayerById
(
pointOfInterestId
);
if
(
!
selectedFeature
||
!
selectedLayer
)
{
console
.
error
(
"
Unable to display selected point
"
+
pointOfInterestId
,
this
.
geoJsonData
.
features
)
return
}
this
.
displaySelectedPoint
(
selectedFeature
,
selectedLayer
,
true
);
selectedLayer
.
openPopup
();
}
...
...
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