Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alfakhori
M4labplatform
Commits
13abc8bd
Commit
13abc8bd
authored
Jan 07, 2022
by
Patrick
Browse files
Noisequiz added
parent
0dfd93ef
Changes
43
Hide whitespace changes
Inline
Side-by-side
vcm/js/favoriteplaces.js
View file @
13abc8bd
...
...
@@ -69,7 +69,160 @@ function setPointFav(location, pointd){
// delete layer if it already exists
framework
.
removeLayerByName
(
location
+
"
point
"
)
// visualizing with vcs GeoJson function
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
if
(
location
==
"
quiz_baustelle
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_spacecadet.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
if
(
location
==
"
quiz_pragfriedhof
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_paologreen.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
if
(
location
==
"
quiz_marktplatz
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_rosybrown.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
if
(
location
==
"
quiz_skaten
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_rosevale.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
if
(
location
==
"
quiz_kirche
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_myrtlegreen.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
if
(
location
==
"
quiz_meerschweinchen
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_babyblue.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
if
(
location
==
"
quiz_ufapalast
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_rubyred.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
if
(
location
==
"
quiz_rostensteinpark
"
){
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
projection
:
{
epsg
:
4326
},
altitudeMode
:
"
relativeToGround
"
,
style
:
{
image
:
{
icon
:
{
src
:
"
./datasource-data/NoiseData/Icons_soundquiz/s_noise_greensheen.png
"
,
scale
:
0.5
}
}
},
heightAboveGround
:
0
})
}
else
{
pointlayer
=
new
vcs
.
vcm
.
layer
.
GeoJSON
({
name
:
location
+
"
point
"
,
url
:
addPointurl
+
"
?slat=
"
+
pointd
.
lat
+
"
&slon=
"
+
pointd
.
lon
+
"
&sloc=
"
+
location
,
data
:
geojson
,
...
...
@@ -87,6 +240,8 @@ function setPointFav(location, pointd){
},
heightAboveGround
:
0
})
}
framework
.
addLayer
(
pointlayer
)
pointlayer
.
activate
(
true
);
}
...
...
@@ -138,7 +293,19 @@ function switchFavPlaces(){
}
}
function
switchQuizResults
(){
var
checkBox
=
document
.
getElementById
(
"
quizcheck
"
);
if
(
checkBox
.
checked
==
true
){
quizAnswerOn
()
}
else
{
quizAnswerOff
()
}
}
// Get Location of User
document
.
getElementById
(
'
getLocationFav
'
).
ontouchstart
=
function
(
eve
)
{
...
...
vcm/js/history.js
View file @
13abc8bd
...
...
@@ -61,11 +61,11 @@ function historyToolbox(){
}
function
historyNordb
(){
history
.
pushState
({
id
:
5
},
'
Info page
'
,
'
./
project/
nordb
'
)
history
.
pushState
({
id
:
5
},
'
Info page
'
,
'
./nordb
'
)
}
function
historyBock
(){
history
.
pushState
({
id
:
6
},
'
Info page
'
,
'
./
project/
bock
'
)
history
.
pushState
({
id
:
6
},
'
Info page
'
,
'
./bock
'
)
}
history
.
replaceState
({
id
:
1
},
'
Default page
'
,
'
./start
'
);
...
...
vcm/js/soundquiz.js
0 → 100644
View file @
13abc8bd
function
quizAnswerOn
()
{
var
quiz_baustelle
=
[
"
quiz_baustelle
"
]
var
quiz_kirche
=
[
"
quiz_kirche
"
]
var
quiz_Marktplatz
=
[
"
quiz_Marktplatz
"
]
var
quiz_Meerschweinchen
=
[
"
quiz_Meerschweinchen
"
]
var
quiz_Pragfriedhof
=
[
"
quiz_Pragfriedhof
"
]
var
quiz_Rosensteinpark
=
[
"
quiz_Rosensteinpark
"
]
var
quiz_Skaten
=
[
"
quiz_Skaten
"
]
var
quiz_UFA_Palast
=
[
"
quiz_UFA_Palast
"
]
var
layers
=
framework
.
getLayers
();
for
(
var
i
=
0
;
i
<
layers
.
length
;
i
++
)
{
var
layer
=
layers
[
i
];
if
(
quiz_baustelle
.
indexOf
(
layer
.
name
)
>=
0
)
{
layer
.
activate
(
true
);
}
else
if
(
quiz_kirche
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
true
);
}
else
if
(
quiz_Marktplatz
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
true
);
}
else
if
(
quiz_Meerschweinchen
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
true
);
}
else
if
(
quiz_Pragfriedhof
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
true
);
}
else
if
(
quiz_Rosensteinpark
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
true
);
}
else
if
(
quiz_Skaten
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
true
);
}
else
if
(
quiz_UFA_Palast
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
true
);
}
}
}
function
quizAnswerOff
()
{
var
quiz_baustelle
=
[
"
quiz_baustelle
"
]
var
quiz_kirche
=
[
"
quiz_kirche
"
]
var
quiz_Marktplatz
=
[
"
quiz_Marktplatz
"
]
var
quiz_Meerschweinchen
=
[
"
quiz_Meerschweinchen
"
]
var
quiz_Pragfriedhof
=
[
"
quiz_Pragfriedhof
"
]
var
quiz_Rosensteinpark
=
[
"
quiz_Rosensteinpark
"
]
var
quiz_Skaten
=
[
"
quiz_Skaten
"
]
var
quiz_UFA_Palast
=
[
"
quiz_UFA_Palast
"
]
var
layers
=
framework
.
getLayers
();
for
(
var
i
=
0
;
i
<
layers
.
length
;
i
++
)
{
var
layer
=
layers
[
i
];
if
(
quiz_baustelle
.
indexOf
(
layer
.
name
)
>=
0
)
{
layer
.
activate
(
false
);
}
else
if
(
quiz_kirche
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
false
);
}
else
if
(
quiz_Marktplatz
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
false
);
}
else
if
(
quiz_Meerschweinchen
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
false
);
}
else
if
(
quiz_Pragfriedhof
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
false
);
}
else
if
(
quiz_Rosensteinpark
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
false
);
}
else
if
(
quiz_Skaten
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
false
);
}
else
if
(
quiz_UFA_Palast
.
indexOf
(
layer
.
name
)
>=
0
){
layer
.
activate
(
false
);
}
}
}
let
baustellePoint
let
point_baustelle
let
point_kirche
let
point_marktplatz
let
point_meerschweinchen
let
point_pragfriedhof
let
point_rosensteinpark
let
point_skaten
let
point_ufapalast
var
poly_baustelle
=
turf
.
polygon
([[[
9.192030041439407
,
48.795435967671466
],
[
9.193216723986483
,
48.79495488792281
],
[
9.193868262453837
,
48.79608377989257
],
[
9.19323753687872
,
48.79624768458771
],
[
9.19272846497538
,
48.79547341656016
],
[
9.192181723252217
,
48.79565298639707
],
[
9.192030041439407
,
48.795435967671466
]]]);
var
poly_kirche
=
turf
.
polygon
([[[
9.188408368748892
,
48.795100250655054
],
[
9.188924612595006
,
48.795012123976335
],
[
9.189098065897257
,
48.79549757627021
],
[
9.188575644592794
,
48.7956045547285
],
[
9.188408368748892
,
48.795100250655054
]]]);
var
poly_Marktplatz
=
turf
.
polygon
([[[
9.190168307967882
,
48.79728419808009
],
[
9.1910874206942
,
48.79725140057769
],
[
9.191087538901344
,
48.79748221171445
],
[
9.190187007187546
,
48.79748110760161
],
[
9.190168307967882
,
48.79728419808009
]]]);
var
poly_Meerschweinchen
=
turf
.
polygon
([[[
9.186806098731616
,
48.79881951602704
],
[
9.188600335393922
,
48.79719781391975
],
[
9.188949173861737
,
48.79762091492424
],
[
9.187848177581678
,
48.79928734715429
],
[
9.186806098731616
,
48.79881951602704
]]]);
var
poly_Pragfriedhof
=
turf
.
polygon
([[[
9.182333160394126
,
48.794227837883454
],
[
9.186647005279728
,
48.79259326288354
],
[
9.186647005279728
,
48.79259326288354
],
[
9.18715941385583
,
48.792952193405455
],
[
9.188289000958733
,
48.79385430267109
],
[
9.188891598423863
,
48.79484809259648
],
[
9.188924740247561
,
48.79612690389061
],
[
9.188799960354077
,
48.79681309093797
],
[
9.18825406781832
,
48.797313503843924
],
[
9.187345300590598
,
48.797925407270014
],
[
9.186793822718
,
48.79823773268251
],
[
9.186096400913614
,
48.79847389780855
],
[
9.185376581862181
,
48.79853414827693
],
[
9.18419156582769
,
48.79836173569811
],
[
9.182740250555623
,
48.79801651120249
],
[
9.182333160394126
,
48.794227837883454
]]]);
var
poly_Rosensteinpark
=
turf
.
polygon
([[[
9.203808052932066
,
48.79875367235891
],
[
9.208012295476198
,
48.79907274921155
],
[
9.20859308579052
,
48.79995508393404
],
[
9.208307227582281
,
48.80047891317108
],
[
9.20655387838112
,
48.80160753910721
],
[
9.206056324076444
,
48.80174552856627
],
[
9.206914332149998
,
48.803294486473106
],
[
9.205121147799815
,
48.80447843399779
],
[
9.204787225158146
,
48.80524383611939
],
[
9.204293772298964
,
48.805772976987896
],
[
9.202644486340354
,
48.80554330738289
],
[
9.200742163801127
,
48.805730074499024
],
[
9.197993600884352
,
48.80570592345538
],
[
9.19408063624374
,
48.806578150352806
],
[
9.192236234986755
,
48.80700516129579
],
[
9.190481412880551
,
48.80711898114146
],
[
9.189377614525243
,
48.80715362417243
],
[
9.189612496570103
,
48.806420338495116
],
[
9.190483699672992
,
48.80542080612048
],
[
9.191367708214424
,
48.804618160154064
],
[
9.192006815165342
,
48.80394202915721
],
[
9.192960405298813
,
48.80329637888474
],
[
9.19511584478854
,
48.80235904555161
],
[
9.196720543284407
,
48.801721976270414
],
[
9.198002225814102
,
48.801426584371825
],
[
9.199607833356552
,
48.80105249758515
],
[
9.200559174570628
,
48.800752502238794
],
[
9.20147085629273
,
48.800194609436886
],
[
9.202729092947616
,
48.79948163061957
],
[
9.203122591861353
,
48.79926610161402
],
[
9.203808052932066
,
48.79875367235891
]]]);
var
poly_Skaten
=
turf
.
polygon
([[[
9.186665264444466
,
48.79273677965645
],
[
9.187115163885181
,
48.79257958028356
],
[
9.18774299900375
,
48.79299776284847
],
[
9.18737613418959
,
48.793241842711154
],
[
9.186665264444466
,
48.79273677965645
]]]);
var
poly_UFA_Palast
=
turf
.
polygon
([[[
9.191762686194787
,
48.793611450616766
],
[
9.19244968983106
,
48.79299940951094
],
[
9.193279947526518
,
48.79382263074581
],
[
9.192640547940316
,
48.794189163732284
],
[
9.191762686194787
,
48.793611450616766
]]]);
var
ptsWithin
var
ptsWithin_bau
var
ptsWithin_prag
var
ptsWithin_markt
var
ptsWithin_skaten
var
ptsWithin_kirche
var
ptsWithin_meerschweinchen
var
ptsWithin_ufa
var
ptsWithin_rosenstein
function
check_Bau
(
location
)
{
if
(
location
==
"
quiz_baustelle
"
){
var
points
=
turf
.
points
([
[
point_baustelle
.
lon
,
point_baustelle
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_baustelle
);
console
.
log
(
ptsWithin
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_bau
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_bau
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
quiz_pragfriedhof
"
){
var
points
=
turf
.
points
([
[
point_pragfriedhof
.
lon
,
point_pragfriedhof
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_Pragfriedhof
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_prag
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_prag
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
quiz_marktplatz
"
){
var
points
=
turf
.
points
([
[
point_marktplatz
.
lon
,
point_marktplatz
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_Marktplatz
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_markt
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_markt
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
quiz_skaten
"
){
var
points
=
turf
.
points
([
[
point_skaten
.
lon
,
point_skaten
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_Skaten
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_skaten
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_skaten
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
quiz_kirche
"
){
var
points
=
turf
.
points
([
[
point_kirche
.
lon
,
point_kirche
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_kirche
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_kirche
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_kirche
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
quiz_meerschweinchen
"
){
var
points
=
turf
.
points
([
[
point_meerschweinchen
.
lon
,
point_meerschweinchen
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_Meerschweinchen
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_meerschweinchen
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_meerschweinchen
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
quiz_ufapalast
"
){
var
points
=
turf
.
points
([
[
point_ufapalast
.
lon
,
point_ufapalast
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_UFA_Palast
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_ufapalast
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_ufapalast
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
quiz_rostensteinpark
"
){
var
points
=
turf
.
points
([
[
point_rosensteinpark
.
lon
,
point_rosensteinpark
.
lat
]
]);
ptsWithin
=
turf
.
pointsWithinPolygon
(
points
,
poly_Rosensteinpark
);
if
(
ptsWithin
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_rosenstein
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_rosenstein
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
else
if
(
location
==
"
all
"
){
var
points_bau
=
turf
.
points
([
[
point_baustelle
.
lon
,
point_baustelle
.
lat
]
]);
ptsWithin_bau
=
turf
.
pointsWithinPolygon
(
points_bau
,
poly_baustelle
);
var
points_prag
=
turf
.
points
([
[
point_pragfriedhof
.
lon
,
point_pragfriedhof
.
lat
]
]);
ptsWithin_prag
=
turf
.
pointsWithinPolygon
(
points_prag
,
poly_Pragfriedhof
);
var
points_markt
=
turf
.
points
([
[
point_marktplatz
.
lon
,
point_marktplatz
.
lat
]
]);
ptsWithin_markt
=
turf
.
pointsWithinPolygon
(
points_markt
,
poly_Marktplatz
);
var
points_skaten
=
turf
.
points
([
[
point_skaten
.
lon
,
point_skaten
.
lat
]
]);
ptsWithin_skaten
=
turf
.
pointsWithinPolygon
(
points_skaten
,
poly_Skaten
);
var
points_kirche
=
turf
.
points
([
[
point_kirche
.
lon
,
point_kirche
.
lat
]
]);
ptsWithin_kirche
=
turf
.
pointsWithinPolygon
(
points_kirche
,
poly_kirche
);
var
points_meer
=
turf
.
points
([
[
point_meerschweinchen
.
lon
,
point_meerschweinchen
.
lat
]
]);
ptsWithin_meerschweinchen
=
turf
.
pointsWithinPolygon
(
points_meer
,
poly_Meerschweinchen
);
var
points_ufa
=
turf
.
points
([
[
point_ufapalast
.
lon
,
point_ufapalast
.
lat
]
]);
ptsWithin_ufa
=
turf
.
pointsWithinPolygon
(
points_ufa
,
poly_UFA_Palast
);
var
points_rosen
=
turf
.
points
([
[
point_rosensteinpark
.
lon
,
point_rosensteinpark
.
lat
]
]);
ptsWithin_rosenstein
=
turf
.
pointsWithinPolygon
(
points_rosen
,
poly_Rosensteinpark
);
if
(
ptsWithin_bau
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_bau
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_bau
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_bau
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
if
(
ptsWithin_prag
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_prag
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_prag
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_prag
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
if
(
ptsWithin_markt
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_markt
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_markt
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_markt
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
if
(
ptsWithin_skaten
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_skaten
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_skaten
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_skaten
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
if
(
ptsWithin_kirche
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_kirche
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_kirche
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_kirche
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
if
(
ptsWithin_meerschweinchen
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_meerschweinchen
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_meerschweinchen
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_meerschweinchen
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
if
(
ptsWithin_ufa
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_ufapalast
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_ufa
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_ufapalast
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
if
(
ptsWithin_rosenstein
.
features
.
length
==
0
){
document
.
getElementById
(
"
solution_rosenstein
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_wrong.png
"
;
}
else
if
(
ptsWithin_rosenstein
.
features
.
length
==
1
){
document
.
getElementById
(
"
solution_rosenstein
"
).
src
=
"
../datasource-data/NoiseData/Icons_soundquiz/icon_right.png
"
;
}
}
//ptsWithin = turf.pointsWithinPolygon(points, poly_baustelle);
// console.log(ptsWithin);
// if (ptsWithin.features.length == 0){
// alert(false);
// } else if (ptsWithin.features.length == 1){
// alert(true);
// }
}
// var polygone= [
// [-73.89632720118, 40.8515320489962],
// [-73.8964878416508, 40.8512476593594],
// [-73.8968799791431, 40.851375925454],
// [-73.8967188588015, 40.851660158514],
// [-73.89632720118, 40.8515320489962]
// ]
// var baustelle = [[9.192030041439407,48.795435967671466],
// [9.193216723986483,48.79495488792281],
// [9.193868262453837,48.79608377989257],
// [9.19323753687872,48.79624768458771],
// [9.19272846497538,48.79547341656016],
// [9.192181723252217,48.79565298639707],
// [9.192030041439407,48.795435967671466]]
// let baustellePoint
// function isPointInPoly(poly, pt){
// for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
// ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1] < poly[i].y))
// && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
// && (c = !c);
// return c;
// }
// function check_Bau() {
// alert(baustellePoint.lon + " - " + baustellePoint.lat)
// alert(isPointInPoly(baustelle, [baustellePoint.lon, baustellePoint.lat]));
// }
\ No newline at end of file
Prev
1
2
3
Next
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