Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
2978d76c
Commit
2978d76c
authored
May 20, 2015
by
duminil
Browse files
Fixed Javascript race condition.
parent
c104f778
Changes
1
Show whitespace changes
Inline
Side-by-side
website/script/simstadt_openlayers.js
View file @
2978d76c
...
...
@@ -117,8 +117,11 @@ var map = new ol.Map({
var
geoJSONformat
=
new
ol
.
format
.
GeoJSON
();
kml_layer
.
addEventListener
(
"
change
"
,
function
(
event
)
{
var
fromJavaFX
=
(
typeof
fxapp
!==
'
undefined
'
);
map
.
getView
().
fitExtent
(
kml_source
.
getExtent
(),
(
map
.
getSize
()));
});
function
updateGMLPolygons
(){
var
fromJavaFX
=
(
typeof
fxapp
!==
'
undefined
'
);
kml_source
.
forEachFeature
(
function
(
feature
)
{
feature
[
"
geoJSON
"
]
=
geoJSONformat
.
writeFeatureObject
(
feature
);
feature
[
"
area
"
]
=
feature
.
getGeometry
().
getArea
();
...
...
@@ -131,7 +134,7 @@ kml_layer.addEventListener("change", function(event) {
}
feature
[
"
available
"
]
=
citygmlHere
;
});
}
);
}
// The features are not added to a regular vector layer/source,
// but to a feature overlay which holds a collection of features.
...
...
@@ -185,6 +188,7 @@ var sketch;
draw
.
on
(
'
drawstart
'
,
function
(
evt
)
{
sketch
=
evt
.
feature
;
reset_btn
.
disabled
=
false
;
updateGMLPolygons
();
});
var
sourceProj
=
map
.
getView
().
getProjection
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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