Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ISRIC
wsm.rest
Commits
77226dc0
Commit
77226dc0
authored
Aug 09, 2016
by
IngridHaas
Browse files
Merge branch 'master' of
https://github.com/ISRICWorldSoil/WSM
parents
2b5569d6
ee5220cf
Changes
36
Show whitespace changes
Inline
Side-by-side
africa/assets/js/tour.js
0 → 100644
View file @
77226dc0
// JavaScript Document
/*
* soils layer
*
* Copyright (c) 2013 Pascal Herijgers
* Eigenveren.nl
*
* Version: 1.0 ()
* Requires: jQuery v1.8.0
* Requires: Google Maps JavaScript API v3
*
* Modified by: Jorge S. Mendes de Jesus
* ISRIC - World Soil Information
*/
/*STARTIN POINT - HACK GOOGLE REQUEST FOR panoid */
var
panoramaOptions
=
{
pano
:
'
0yULvdzU1A0AAAQvOixlLg
'
,
pov
:
{
heading
:
390
,
pitch
:
0
,
zoom
:
1.0
},
visible
:
true
,
};
var
panoWidth
;
var
panoHeight
;
var
workItems
;
soilinfo
=
[
'
<img src="info.png" width="25" height="25" alt="Info">
'
,
'
<img src="detail.png" width="25" height="25" alt="Details">
'
,
'
<img src="pdf.png" width="25" height="25" alt="Description">
'
,
'
<img src="youtube.png" width="25" height="25" alt="Video">
'
];
var
panorama
;
var
displayItems
;
function
setWorkItems
(){
workItems
=
$
.
grep
(
displayItems
,
function
(
n
)
{
return
(
n
.
pano
==
panorama
.
getPano
()
);
});
$
(
'
[id^="item"]
'
).
remove
();
for
(
var
i
=
0
;
i
<
workItems
.
length
;
i
++
)
{
str
=
'
<div class="soil" id="item
'
+
i
+
'
"><a target="_blank" href="
'
+
workItems
[
i
].
url
+
'
">
'
+
soilinfo
[
workItems
[
i
].
icon
]
+
'
</a></div>
'
;
$
(
'
#soils
'
).
append
(
str
);
}
window
.
setTimeout
(
function
(){
google
.
maps
.
event
.
trigger
(
panorama
,
'
pov_changed
'
)},
500
);
//cant get a proper trigger to display the content
};
//end setWorkItems END OF SCRIPT LOGIC
function
readSettings
(){
$
.
ajax
({
global
:
false
,
type
:
"
GET
"
,
cache
:
false
,
dataType
:
"
json
"
,
url
:
"
assets/tour/leuven_tour.json
"
,
success
:
function
(
data
)
{
// file not foundgi
if
(
data
===
false
)
{
console
.
log
(
'
Cannot load file:
'
+
inputFile
+
'
.json
'
);
return
;
}
displayItems
=
data
;
setWorkItems
();
//callback jump
},
error
:
function
(
jqXHR
,
textStatus
,
errorThrown
)
{
//maybe bit to extreme..
document
.
write
(
jqXHR
.
responseText
);
},
async
:
true
});
}
//end of read settings; //
function
addEvents
(){
google
.
maps
.
event
.
addListener
(
panorama
,
'
pano_changed
'
,
function
()
{
//http://10.75.13.42:8000/index_tour.html
//pov forceren om letter te laten zien
var
hHeading
=
panorama
.
getPov
().
heading
;
var
hPitch
=
panorama
.
getPov
().
pitch
;
panorama
.
setPov
({
heading
:
hHeading
,
pitch
:
hPitch
});
try
{
setWorkItems
();
}
catch
(
err
)
{
console
.
log
(
err
)
}
});
//end of pano_changed event
google
.
maps
.
event
.
addListener
(
panorama
,
'
pov_changed
'
,
function
()
{
//console.log(panorama)
heading
=
panorama
.
getPov
().
heading
;
pitch
=
panorama
.
getPov
().
pitch
;
var
hSetting
=
0
,
// heading uit de file
vSetting
=
0
,
// pitch uit de file
left
=
0
,
// hulpvar voor left waarbij 360 graden rond verwerkt is
right
=
0
,
// hulpvar voor right waarbij 360 graden rond verwerkt is
leftPos
=
0
,
// hulpvar voor berekende left position
topPos
=
0
,
// hulpvar voor berekende top position
factor
=
0
,
// hulpvar voor horizontale sinus correctie
corrFactor
=
0
,
// hulpvar voor horizontale sinus correctie
aspectRatio
=
0
,
// aspectratio van pano
corrFactorPitch
=
0
,
// hulpvar voor pitch rekning houdend met verschillende viewport aspectratio's
corrPitch
=
0
,
// hulpvar voor pitch rekning houdend met verschillende viewport aspectratio's
widthItem
=
0
,
// breedte van item dat getoond wordt
heightItem
=
0
;
// hoogte van item dat getoond wordt
zoomLevel
=
panorama
.
getZoom
();
// het zoomlevel
var
zoomCorrH
=
Math
.
pow
(
1.75
,
zoomLevel
-
1
);
// correctie heading ivm zoom
var
zoomCorrP
=
Math
.
pow
(
1.95
,
zoomLevel
-
1
);
// correctie pitch ivm zoom
if
(
panoWidth
>
panoHeight
)
{
aspectRatio
=
panoWidth
/
panoHeight
;
}
else
{
aspectRatio
=
panoHeight
/
panoWidth
;
}
//berekenen van verticale aanpassing ivm andere viewport bij andere aspectratio
corrFactorPitch
=
50
+
5
*
Math
.
pow
(
aspectRatio
,
2
)
-
2
;
corrPitch
=
panoHeight
/
panoWidth
*
corrFactorPitch
;
//start try here
try
{
for
(
var
i
=
0
;
i
<
workItems
.
length
;
i
++
)
{
hSetting
=
parseFloat
(
workItems
[
i
].
heading
);
vSetting
=
parseFloat
(
workItems
[
i
].
pitch
);
left
=
hSetting
-
(
45
/
zoomCorrH
);
right
=
hSetting
+
(
45
/
zoomCorrH
);
if
(
left
<
0
)
{
left
=
360
+
left
;
}
if
(
right
>
360
)
{
right
=
right
-
360
;
}
if
(
heading
<
0
)
{
heading
=
360
+
heading
;
}
// this was missing and therefore
if
(
heading
>
360
)
{
heading
=
heading
-
360
;
}
if
(
left
>
right
)
{
if
(
heading
<
(
90
/
zoomCorrH
))
{
heading
=
heading
+
360
;
}
right
=
right
+
360
;
}
widthItem
=
document
.
getElementById
(
'
item
'
+
i
).
clientWidth
;
//right > heading
if
(
left
<
heading
)
{
document
.
getElementById
(
'
item
'
+
i
).
style
.
display
=
'
block
'
;
//berekenen van horizontale correctie
factor
=
1.0
*
((
heading
-
left
)
/
(
90
/
zoomCorrH
));
corrFactor
=
1
+
(
Math
.
sin
(
2
*
Math
.
PI
*
factor
)
/
30
);
//change to 30 seems to be better
leftPos
=
panoWidth
-
Math
.
round
(
factor
*
corrFactor
*
panoWidth
);
document
.
getElementById
(
'
item
'
+
i
).
style
.
left
=
leftPos
.
toString
()
+
'
px
'
;
heightItem
=
document
.
getElementById
(
'
item
'
+
i
).
clientHeight
;
if
(
pitch
<
(
vSetting
+
(
corrPitch
/
zoomCorrP
)
)
&&
pitch
>
(
vSetting
-
(
corrPitch
/
zoomCorrP
)))
{
topPos
=
panoHeight
-
Math
.
abs
(
Math
.
round
(
((
pitch
-
vSetting
-
(
corrPitch
/
zoomCorrP
)
)
/
((
corrPitch
*
2
-
2
)
/
zoomCorrP
))
*
panoHeight
)
);
document
.
getElementById
(
'
item
'
+
i
).
style
.
top
=
topPos
.
toString
()
+
'
px
'
;
}
else
{
document
.
getElementById
(
'
item
'
+
i
).
style
.
display
=
'
none
'
;
}
}
else
{
document
.
getElementById
(
'
item
'
+
i
).
style
.
display
=
'
none
'
;
}
}
//end of for loop
}
catch
(
err
)
{
//do nothing
};
//try for IE
});
//end of pov end
//Necessary reajust when zoom is changed
google
.
maps
.
event
.
addListener
(
panorama
,
'
zoom_changed
'
,
function
(){
google
.
maps
.
event
.
trigger
(
panorama
,
'
pov_changed
'
)})
};
// end addevents
function
initTour
(){
//jQuery( document ).ready(function() {
panorama
=
new
google
.
maps
.
StreetViewPanorama
(
document
.
getElementById
(
'
pano
'
),
panoramaOptions
);
panoWidth
=
document
.
getElementById
(
'
pano
'
).
offsetWidth
;
panoHeight
=
document
.
getElementById
(
'
pano
'
).
offsetHeight
;
addEvents
();
readSettings
();
//});
}
\ No newline at end of file
africa/assets/tour/detail.png
0 → 100644
View file @
77226dc0
3.67 KB
africa/assets/tour/info.png
0 → 100644
View file @
77226dc0
4.44 KB
africa/assets/tour/leuven_tour.json
0 → 100644
View file @
77226dc0
[
{
"monolith"
:
"understanding soil nr 1 Dystric regosol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-id010"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"1yp4pugP5JAAAAQvOiwz0g"
,
"heading"
:
490
,
"icon"
:
0.0
},
{
"monolith"
:
"understanding soil 2 Gleyic acrisol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ng015"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"1yp4pugP5JAAAAQvOiwz0g"
,
"heading"
:
420
,
"icon"
:
0.0
},
{
"monolith"
:
"understanding soilvolgnr3 Vertisol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-zw006"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"GRAhZRLHDPEAAAQvOi1DOg"
,
"heading"
:
485
,
"icon"
:
0.0
},
{
"monolith"
:
"understanding soilvolgnr 4"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-hu020"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"GRAhZRLHDPEAAAQvOi1DOg"
,
"heading"
:
430
,
"icon"
:
0.0
},
{
"monolith"
:
"What are soils made of 5"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-eak11"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"vH3gxHh52DgAAAQvOiqBsg"
,
"heading"
:
415
,
"icon"
:
0.0
},
{
"monolith"
:
"What are soils made of 6"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ng004"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"vH3gxHh52DgAAAQvOiqBsg"
,
"heading"
:
425
,
"icon"
:
0.0
},
{
"monolith"
:
"What are soils made of 7"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-nig22"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"vH3gxHh52DgAAAQvOiqBsg"
,
"heading"
:
485
,
"icon"
:
0.0
},
{
"monolith"
:
"What are soils made of 8"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-jm004"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"vH3gxHh52DgAAAQvOiqBsg"
,
"heading"
:
495
,
"icon"
:
0.0
},
{
"monolith"
:
"vitrine 9 Arenosol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ml006"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"XBpMl7XEPCQAAAQvOiqBsw"
,
"heading"
:
480
,
"icon"
:
0.0
}
,
{
"monolith"
:
"vitrine 10 Ferralsol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ga004"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"XBpMl7XEPCQAAAQvOiqBsw"
,
"heading"
:
490
,
"icon"
:
0.0
}
,
{
"monolith"
:
"Forest CD1 Xantic ferralsol 11"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-cd001"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"GMBH_aycTdsAAAQvOiloKA"
,
"heading"
:
340
,
"icon"
:
0.0
}
,
{
"monolith"
:
"What is a color"
,
"url"
:
"pdf/Atlas-focus-04_A3.pdf"
,
"notes"
:
"pic"
,
"pitch"
:
15
,
"pano"
:
"GMBH_aycTdsAAAQvOiloKA"
,
"heading"
:
306
,
"icon"
:
2.0
}
,
{
"monolith"
:
"Termites"
,
"url"
:
"pdf/Atlas-focus-02_A3.pdf"
,
"notes"
:
"pic"
,
"pitch"
:
-15
,
"pano"
:
"sVcHNOIcnhkAAAQvOisMmg"
,
"heading"
:
470
,
"icon"
:
2.0
}
,
{
"monolith"
:
"Agroforestry"
,
"url"
:
"pdf/Atlas-focus-02_A3.pdf"
,
"notes"
:
"pic"
,
"pitch"
:
-11
,
"pano"
:
"iN5PlwpDWCYAAAQvOi1DPw"
,
"heading"
:
423
,
"icon"
:
2.0
}
,
{
"monolith"
:
"vitrine rare vormen bovenste"
,
"url"
:
"images/leuven_tour/spinshape.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
5
,
"pano"
:
"iN5PlwpDWCYAAAQvOi1DPw"
,
"heading"
:
52
,
"icon"
:
1.0
}
,
{
"monolith"
:
"vitrine rare vormen onder 1"
,
"url"
:
"images/leuven_tour/Rechts_majorSoilscapes.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
-10
,
"pano"
:
"iN5PlwpDWCYAAAQvOi1DPw"
,
"heading"
:
32
,
"icon"
:
1.0
}
,
{
"monolith"
:
"vitrine rare vormen onder 2"
,
"url"
:
"images/leuven_tour/Paddestoelvorm.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
-10
,
"pano"
:
"iN5PlwpDWCYAAAQvOi1DPw"
,
"heading"
:
42
,
"icon"
:
1.0
}
,
{
"monolith"
:
"vitrine rare vormen onder 3"
,
"url"
:
"images/leuven_tour/Gedrochten.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
-10
,
"pano"
:
"iN5PlwpDWCYAAAQvOi1DPw"
,
"heading"
:
52
,
"icon"
:
1.0
}
,
{
"monolith"
:
"Soilscapes of African mountains 12 KE39"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ke039"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"SMlqfFM4VCcAAAQvOi1DOw"
,
"heading"
:
342
,
"icon"
:
0.0
},
{
"monolith"
:
"The trouble with vertisols"
,
"url"
:
"pdf/Atlas-focus-05_A3.pdf"
,
"notes"
:
"pic"
,
"pitch"
:
-15
,
"pano"
:
"SMlqfFM4VCcAAAQvOi1DOw"
,
"heading"
:
-44
,
"icon"
:
2.0
}
,
{
"monolith"
:
"Soilscapes of African mountains 13 KE44 Nitisol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ke044"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"SMlqfFM4VCcAAAQvOi1DOw"
,
"heading"
:
400
,
"icon"
:
0.0
},
{
"monolith"
:
"Soilscapes of African mountains 14 KE70 vertisol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ke070"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"SMlqfFM4VCcAAAQvOi1DOw"
,
"heading"
:
410
,
"icon"
:
0.0
},
{
"monolith"
:
"Soilscapes of African mountains 14 KE70 vertisol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ke070"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"XBpMl7XEPCQAAAQvOiqBsw"
,
"heading"
:
410
,
"icon"
:
0.0
},
{
"monolith"
:
"Stenen vitrine bij what is in a color"
,
"url"
:
"/images/leuven_tour/Plinthite.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
-20
,
"pano"
:
"XBpMl7XEPCQAAAQvOiqBsw"
,
"heading"
:
410
,
"icon"
:
1.0
},
{
"monolith"
:
"open stenen tafel"
,
"url"
:
"images/leuven_tour/Bauxite.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
-10
,
"pano"
:
"zCAQow75uOoAAAQvOiloLA"
,
"heading"
:
-2
,
"icon"
:
1.0
}
,
{
"monolith"
:
"Soilscapes of the Sahel and Savannah zone 16"
,
"url"
:
"http://rest.museum2.isric.org/monoliths/original/jpg/HU-021-def.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"sVcHNOIcnhkAAAQvOisMmg"
,
"heading"
:
400
,
"icon"
:
0.0
}
,
{
"monolith"
:
"Soilscapes of the Sahel and Savannah zone 17"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ng016"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"sVcHNOIcnhkAAAQvOisMmg"
,
"heading"
:
410
,
"icon"
:
0.0
}
,
{
"monolith"
:
"Soilscapes of the Sahel and Savannah zone 18"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ke003"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"sVcHNOIcnhkAAAQvOisMmg"
,
"heading"
:
320
,
"icon"
:
0.0
}
,
{
"monolith"
:
"Soilscapes of the Sahel and Savannah zone 18"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ke003"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"hNlnVEO_8ycAAAQvOiloKw"
,
"heading"
:
400
,
"icon"
:
0.0
}
,
{
"monolith"
:
"--ferralsol,plinthosol,plinthosol 19 NIG 021"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ng021"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"a61Npy-PHokAAAQvOiPUPg"
,
"heading"
:
353
,
"icon"
:
0.0
},
{
"monolith"
:
"ferralsol,--plinthosol,plinthosol 20ZW11"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-zw011"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"a61Npy-PHokAAAQvOiPUPg"
,
"heading"
:
363
,
"icon"
:
0.0
},
{
"monolith"
:
"Unforgiving iron"
,
"url"
:
"pdf/Atlas-focus-06_A3.pdf"
,
"notes"
:
"pic"
,
"pitch"
:
-29
,
"pano"
:
"a61Npy-PHokAAAQvOiPUPg"
,
"heading"
:
39
,
"icon"
:
2.0
}
,
{
"monolith"
:
"vitrine"
,
"url"
:
"images/leuven_tour/"
,
"notes"
:
"pic"
,
"pitch"
:
17
,
"pano"
:
"a61Npy-PHokAAAQvOiPUPg"
,
"heading"
:
85
,
"icon"
:
1.0
}
,
{
"monolith"
:
"ferralsol,plinthosol,--plinthosol 21 ML007"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ml007"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"a61Npy-PHokAAAQvOiPUPg"
,
"heading"
:
375
,
"icon"
:
0.0
},
{
"monolith"
:
"Soilscapes of the Sahel and Savannah zone 22"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ga002"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"hNlnVEO_8ycAAAQvOiloKw"
,
"heading"
:
330
,
"icon"
:
0.0
}
,
{
"monolith"
:
"Soilscapes of the Sahel and Savannah zone 23"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-mz006"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"hNlnVEO_8ycAAAQvOiloKw"
,
"heading"
:
338
,
"icon"
:
0.0
}
,
{
"monolith"
:
"Food or Cashcrops"
,
"url"
:
"pdf/Atlas-focus-07_A3.pdf"
,
"notes"
:
"pic"
,
"pitch"
:
4
,
"pano"
:
"hNlnVEO_8ycAAAQvOiloKw"
,
"heading"
:
-52
,
"icon"
:
2.0
}
,
{
"monolith"
:
"video"
,
"url"
:
"http:/museum.isric.org/sites/default/files/videos/original/all_interviews_compressed.mp4"
,
"notes"
:
"pic"
,
"pitch"
:
-23.24082073344907
,
"pano"
:
"3phuMq4AzRgAAAQvOisMoA"
,
"heading"
:
276.04699738903383
,
"icon"
:
3.0
},
{
"monolith"
:
"River Valleys and Wetlands nr 24 Fluvisol Mali"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-ml005"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"xhkLI3QNFbcAAAQvOisMnQ"
,
"heading"
:
330.04699738903383
,
"icon"
:
0.0
},
{
"monolith"
:
"River Valleys and Wetlands nr 25 Gleysol"
,
"url"
:
"http://isis.isric.org/monoliths/reference-soil-zw007"
,
"notes"
:
"pic"
,
"pitch"
:
-30
,
"pano"
:
"xhkLI3QNFbcAAAQvOisMnQ"
,
"heading"
:
222
,
"icon"
:
0.0
},
{
"monolith"
:
"video2"
,
"url"
:
"http://rest.museum2.isric.org/monoliths/original/jpg/HU-019-def.jpg"
,
"notes"
:
"pic"
,
"pitch"
:
-23.24082073344907
,
"pano"
:
"gTwhDbpqOwAAAQvOixlMA"
,
"heading"
:
291.04699738903383
,
"icon"
:
3.0
},
{
"monolith"
:
"When good soils turn bad"
,
"url"
:
"pdf/Atlas-focus-08_A3.pdf"
,
"notes"
:
"pic"
,
"pitch"
:
-27
,