Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
iCity
EnergyDashboard
Commits
57149df7
Commit
57149df7
authored
Jun 28, 2021
by
Sven Schneider
Browse files
made an array that contains data of all bld for vorlauf
parent
e50e245c
Changes
1
Show whitespace changes
Inline
Side-by-side
public/js/appCesium.js
View file @
57149df7
...
...
@@ -26,6 +26,8 @@ import {
PARAM_SELECT
,
}
from
"
./appChart.js
"
;
var
ALLDATA
=
[];
Cesium
.
Ion
.
defaultAccessToken
=
"
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyODgxYzJlNi1kNDZiLTQ3ZmQtYmUxYy0yMWI0OGM3NDA5MzAiLCJpZCI6NDczOSwic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU0MTUyMzU0MX0.shj2hM3pvsvcmE_wMb2aBDuk_cKWmFmbolltInGImwU
"
;
...
...
@@ -46,13 +48,13 @@ const viewer = new Cesium.Viewer("cesiumGlobeContainer", {
* @param {String} urlTiles URL to the 3DTiles to be loaded
* @returns {undefined} undefined
*/
const
loadTiles
=
function
(
urlTiles
)
{
const
loadTiles
=
function
(
urlTiles
)
{
const
tileset
=
new
Cesium
.
Cesium3DTileset
({
url
:
urlTiles
,
});
viewer
.
scene
.
primitives
.
add
(
tileset
);
tileset
.
readyPromise
.
then
(
function
()
{
tileset
.
readyPromise
.
then
(
function
()
{
viewer
.
zoomTo
(
tileset
,
...
...
@@ -61,7 +63,7 @@ const loadTiles = function(urlTiles) {
tileset
.
boundingSphere
.
radius
/
0.5
)
)
.
otherwise
(
function
(
err
)
{
.
otherwise
(
function
(
err
)
{
throw
err
;
});
});
...
...
@@ -72,7 +74,7 @@ const loadTiles = function(urlTiles) {
* @param{*}
* @returns {undefined} undefined
*/
const
loadNonDetailed
=
function
()
{
const
loadNonDetailed
=
function
()
{
// Paths to data sources
const
URL_3DTILES
=
"
data_3d/3dtiles/1_full/tileset.json
"
;
...
...
@@ -86,7 +88,7 @@ const loadNonDetailed = function() {
* @param {String} gltfId Name of the glTF model file without the extension i.e. exclude the `.gltf` suffix
* @returns {undefined} undefined
*/
const
gltfLoad
=
function
(
gltfUrl
,
gltfId
)
{
const
gltfLoad
=
function
(
gltfUrl
,
gltfId
)
{
const
modelMatrix
=
Cesium
.
Transforms
.
eastNorthUpToFixedFrame
(
Cesium
.
Cartesian3
.
fromDegrees
(
9.083385
,
48.881342
,
0
)
);
...
...
@@ -106,7 +108,7 @@ const gltfLoad = function(gltfUrl, gltfId) {
* @param{*}
* @returns {undefined} undefined
*/
const
loadDetailed
=
function
()
{
const
loadDetailed
=
function
()
{
// Paths to data sources
const
URL_3DTILES
=
"
data_3d/3dtiles/2_partial/tileset.json
"
;
const
URL_GLTF
=
"
data_3d/gltf
"
;
...
...
@@ -171,7 +173,7 @@ if (!LOAD_DETAILED_BLDG225) {
* @param {*}
* @returns {undefined}
*/
const
activate3DTileFeaturePicking
=
function
()
{
const
activate3DTileFeaturePicking
=
function
()
{
// HTML overlay for showing feature name on mouseover
const
nameOverlay
=
document
.
createElement
(
"
div
"
);
viewer
.
container
.
appendChild
(
nameOverlay
);
...
...
@@ -308,7 +310,22 @@ const activate3DTileFeaturePicking = function() {
);
const
PARAM_FILTER
=
createTemporalFilterString
(
"
2020-01-01
"
,
"
2021-01-01
"
);
const
axiosGetRequest
=
axios
.
get
(
BASE_URL_OBSERVATIONS
,
{
// const axiosGetRequest = axios.get(BASE_URL_OBSERVATIONS, {
// params: {
// "$resultFormat": PARAM_RESULT_FORMAT,
// "$orderBy": PARAM_ORDER_BY,
// "$filter": PARAM_FILTER,
// "$select": PARAM_SELECT,
// },
// });
const
buildingIDs
=
[
75
,
76
,
77
,
78
,
79
,
80
];
// var ALLDATA = [];
for
(
var
bld
=
0
;
bld
<
buildingIDs
.
length
;
bld
++
)
{
var
baseUrlBld
=
getObservationsUrl
(
BASE_URL
,
buildingIDs
[
bld
]);
const
axiosGetRequest
=
axios
.
get
(
baseUrlBld
,
{
params
:
{
"
$resultFormat
"
:
PARAM_RESULT_FORMAT
,
"
$orderBy
"
:
PARAM_ORDER_BY
,
...
...
@@ -317,7 +334,6 @@ const activate3DTileFeaturePicking = function() {
},
});
// Get "ALL" the Observations that satisfy our query
followNextLink
(
axiosGetRequest
)
.
then
((
success
)
=>
{
...
...
@@ -340,15 +356,23 @@ const activate3DTileFeaturePicking = function() {
return
combinedObservations
;
})
.
catch
((
err
)
=>
{
console
.
log
(
"
ERROR:
"
)
console
.
log
(
err
);
})
.
then
((
observationArr
)
=>
{
var
agg
=
aggregateResponse
(
observationArr
,
0
,
'
mean
'
);
ALLDATA
.
push
(
agg
);
// console.log(agg);
drawHeatMapHC
(
formatSTAResponseForHeatMap
(
agg
));
drawLineChartHC
(
formatSTAResponseForLineChart
(
agg
));
console
.
log
(
ALLDATA
.
length
);
// alert('waiting...');
});
}
},
Cesium
.
ScreenSpaceEventType
.
LEFT_CLICK
);
};
...
...
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