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
1e0db345
Commit
1e0db345
authored
2 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Kinda working import
parent
3ad6d82d
master
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+23
-3
...stadt/regionchooser/website/script/simstadt_openlayers.js
with
23 additions
and
3 deletions
+23
-3
src/main/resources/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+
23
-
3
View file @
1e0db345
...
...
@@ -67,7 +67,7 @@ const regionChooser = (function(){
const
kmlFormat
=
new
ol
.
format
.
KML
({
extractStyles
:
false
});
kml_source
.
addEventListener
(
"
addfeature
"
,
function
()
{
map
.
getView
().
fitExtent
(
kml_source
.
getExtent
(),
(
map
.
getSize
())
)
;
map
.
getView
().
fitExtent
(
kml_source
.
getExtent
(),
map
.
getSize
());
});
function
updateGMLPolygons
()
{
...
...
@@ -383,10 +383,30 @@ const regionChooser = (function(){
}
importWKT
=
function
(
e
){
console
.
log
(
"
Let's import WKT
!!!
"
);
console
.
log
(
"
Let's import WKT
Polygon :
"
+
wktPolygon
);
var
wktPolygon
=
document
.
getElementById
(
"
wktPolygon
"
).
value
;
console
.
log
(
wktPolygon
);
var
wktFormat
=
new
ol
.
format
.
WKT
();
var
feature
=
wktFormat
.
readFeature
(
wktPolygon
,
{
dataProjection
:
ol
.
proj
.
get
(
'
EPSG:4326
'
),
featureProjection
:
ol
.
proj
.
get
(
'
EPSG:3857
'
)
});
//TODO: Check if import was succesful
sketch
=
feature
;
updateGMLPolygons
();
drawnLayer
.
getFeatures
().
clear
();
intersections
.
clear
();
drawnLayer
.
addFeature
(
feature
);
map
.
getView
().
fitExtent
(
feature
.
getGeometry
().
getExtent
(),
map
.
getSize
());
displayInfo
();
draw
.
setActive
(
false
);
e
.
preventDefault
();
// to avoid refresh
}
// Executed by JavaFX when whole page is loaded.
...
...
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