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
b842320c
Commit
b842320c
authored
7 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
RegionChooser: Sorted projects.
parent
f83c2a68
master
develop
migrate_to_Java11
0.2.2
0.1.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+7
-11
...stadt/regionchooser/website/script/simstadt_openlayers.js
with
7 additions
and
11 deletions
+7
-11
src/eu/simstadt/regionchooser/website/script/simstadt_openlayers.js
+
7
-
11
View file @
b842320c
...
...
@@ -125,10 +125,8 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
kml_source
.
forEachFeature
(
function
(
feature
)
{
feature
[
"
geoJSON
"
]
=
geoJsonFormat
.
writeFeatureObject
(
feature
);
feature
[
"
area
"
]
=
feature
.
getGeometry
().
getArea
();
var
project
=
feature
.
get
(
"
project
"
);
var
name
=
feature
.
get
(
"
name
"
);
feature
[
"
project
"
]
=
project
;
feature
[
"
name
"
]
=
name
;
feature
[
"
project
"
]
=
feature
.
get
(
"
project
"
);
feature
[
"
name
"
]
=
feature
.
get
(
"
name
"
);
feature
[
"
source
"
]
=
"
CityGML
"
;
});
}
...
...
@@ -156,6 +154,7 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
});
featureOverlay
.
setMap
(
map
);
//TODO: Rename to Javascript naming convention (CamelCase).
var
selected_features
=
featureOverlay
.
getFeatures
();
selected_features
.
on
(
'
add
'
,
function
(
event
)
{
var
feature
=
event
.
element
;
...
...
@@ -218,7 +217,6 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
}
}
//TODO: Use Javascript names (intersection_found => intersectionFound)
function
findIntersections
()
{
var
polygon
=
geoJsonFormat
.
writeFeatureObject
(
sketch
);
var
polygonArea
=
sketch
.
getGeometry
().
getArea
();
...
...
@@ -228,12 +226,12 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
features_by_project
[
"
NovaFactory
"
]
=
novafactory_vectors
.
getFeatures
();
Object
.
keys
(
features_by_project
).
forEach
(
function
(
project
)
{
Object
.
keys
(
features_by_project
).
sort
().
forEach
(
function
(
project
)
{
features
=
features_by_project
[
project
];
features_and_intersections
=
features
.
map
(
f
=>
[
f
,
findIntersection
(
f
,
polygon
)]).
filter
(
l
=>
l
[
1
]
!==
undefined
);
if
(
features_and_intersections
.
length
>
0
){
intersection_found
=
true
;
dataPanel
.
append
(
"
<h2
class='
"
+
project
+
"
'
>
"
+
project
);
dataPanel
.
append
(
"
<h2>
"
+
project
);
features_and_intersections
.
forEach
(
l
=>
showLinkToDownload
(
l
[
0
],
l
[
1
],
polygonArea
));
}
});
...
...
@@ -261,7 +259,7 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
fxapp
.
downloadRegionFromCityGML
(
sketchAsWKT
(
srsName
),
feature
.
get
(
"
project
"
),
feature
.
get
(
"
name
"
),
srsName
);
var
end
=
new
Date
().
getTime
();
var
time
=
end
-
start
;
console
.
log
(
'
Download Execution time:
'
+
(
time
/
1000
.0
).
toFixed
(
3
)
+
'
s
'
);
console
.
log
(
'
Download Execution time:
'
+
(
time
/
1000
).
toFixed
(
3
)
+
'
s
'
);
setTimeout
(
function
()
{
$
(
"
html
"
).
removeClass
(
"
wait
"
);
dataPanel
.
append
(
"
Done<br/>
\n
"
);
...
...
@@ -292,8 +290,7 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
dataPanel
.
append
(
"
WGS84 Coordinates<br/>
"
);
dataPanel
.
append
(
wgs84_coords
+
"
<br/>
\n
"
);
}
dataPanel
.
append
(
"
Area
"
+
"
<br/>
\n
"
);
dataPanel
.
append
((
Math
.
round
(
area
/
1000
)
/
10
).
toString
()
+
"
ha<br/><br/>
\n
"
);
dataPanel
.
append
(
"
<h3>Area :
"
+
(
area
/
10000
).
toFixed
(
1
)
+
"
ha<br/><br/>
\n
"
);
findIntersections
();
}
...
...
@@ -361,7 +358,6 @@ proj4.defs("EPSG:28992", "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.3876388
function
focusOnMap
()
{
$
(
'
#map
'
).
focus
();
// $('#map').scrollIntoView();
}
var
fxapp
=
undefined
;
...
...
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