Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
8f4df31b
Commit
8f4df31b
authored
2 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Allow holes in polygon, just for fun.
parent
371d6127
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+4
-1
...stadt/regionchooser/website/script/simstadt_openlayers.js
with
4 additions
and
1 deletion
+4
-1
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+
4
-
1
View file @
8f4df31b
...
...
@@ -377,7 +377,7 @@ const regionChooser = (function(){
dataPanel
.
append
(
"
<a href='http://simstadt.hft-stuttgart.de/related-softwares/region-chooser/'>SimStadt documentation</a><br>
\n
"
);
dataPanel
.
append
(
"
<form id='importWKT' style='position:fixed; bottom:0;'>
\n
"
+
"
<input id='wktPolygon' type='text' placeholder='WKT Polygon'
"
+
"
required pattern=' *POLYGON *
\\
( *
\\
([
\\
-0-9
\
., ]+
\\
) *
\\
) *'
"
+
"
required pattern=' *POLYGON *
\\
( *
\\
([
\\
-0-9
\
.,
\
)
\
()
]+
\\
) *
\\
) *'
"
+
"
title='Please input a valid WKT Polygon. Example : POLYGON((9.961675 49.807053, 9.951375 49.798521, 9.969486 49.797746, 9.961675 49.807053)) '/>
\n
"
+
"
<input type='submit' value='Import Polygon'/>
\n
"
+
"
</form>
\n
"
);
...
...
@@ -411,6 +411,7 @@ const regionChooser = (function(){
var
coordinatesCount
=
feature
.
getGeometry
().
getLinearRing
(
0
).
getCoordinates
().
length
-
1
;
if
(
coordinatesCount
<
2
){
console
.
error
(
"
Too few points!
"
);
dataPanel
.
prepend
(
"
<h2 class='error'>There should be at least 2 points in WKT polygon</h2><br/>
\n
"
);
return
false
;
}
...
...
@@ -426,6 +427,8 @@ const regionChooser = (function(){
displayInfo
();
draw
.
setActive
(
false
);
console
.
log
(
"
Import was succesful!
"
);
dataPanel
.
prepend
(
"
<h2 class='ok'>WKT Polygon succesfully imported!</h2><br/>
"
);
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets