Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
4218fabd
Commit
4218fabd
authored
Mar 15, 2023
by
Eric Duminil
Browse files
Show a warning if no gml was found
parent
23f6be67
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
View file @
4218fabd
...
...
@@ -87,6 +87,8 @@ const regionChooser = (function(){
features_by_project
=
utils
.
groupBy
(
features
,
"
project
"
);
// Sort CityGMLs inside each project
Object
.
values
(
features_by_project
).
forEach
(
features
=>
features
.
sort
((
a
,
b
)
=>
a
.
name
.
localeCompare
(
b
.
name
)));
return
features
.
length
;
}
// The features are not added to a regular vector layer/source,
...
...
@@ -404,7 +406,7 @@ const regionChooser = (function(){
featureProjection
:
ol
.
proj
.
get
(
'
EPSG:3857
'
)
});
}
catch
(
e
){
console
.
error
(
"
Couldn't import geometry!
"
);
console
.
warn
(
"
Couldn't import geometry!
"
);
dataPanel
.
prepend
(
"
<h2 class='error'>Couldn't import geometry!</h2><br/>
\n
"
);
return
false
;
}
...
...
@@ -413,7 +415,7 @@ const regionChooser = (function(){
var
coordinatesCount
=
feature
.
getGeometry
().
getLinearRing
(
0
).
getCoordinates
().
length
-
1
;
if
(
coordinatesCount
<
2
){
console
.
error
(
"
Too few points!
"
);
console
.
warn
(
"
Too few points!
"
);
dataPanel
.
prepend
(
"
<h2 class='error'>There should be at least 2 points in WKT polygon</h2><br/>
\n
"
);
return
false
;
}
...
...
@@ -437,8 +439,12 @@ const regionChooser = (function(){
// Executed by JavaFX when whole page is loaded.
publicScope
.
ready
=
function
()
{
updateGMLPolygons
();
var
n
=
updateGMLPolygons
();
displayHelp
();
if
(
n
==
0
){
console
.
warn
(
"
No CityGML found!
"
);
dataPanel
.
prepend
(
"
<h2 class='error'>No CityGML has been found!<br/>repository/name.proj/file.gml</h2><br/>
\n
"
);
}
document
.
documentElement
.
className
=
''
;
// Stop waiting
console
.
log
(
"
Ready!
"
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment