Commit cf8c7a82 authored by BujarMuharemi's avatar BujarMuharemi
Browse files

removed roofview

parent ccc82897
...@@ -9,43 +9,45 @@ var viewer = new Cesium.Viewer('cesiumContainer', { ...@@ -9,43 +9,45 @@ var viewer = new Cesium.Viewer('cesiumContainer', {
animation: false, animation: false,
sceneModePicker: false, sceneModePicker: false,
geocoder: false, geocoder: false,
sceneMode : Cesium.SceneMode.SCENE3D sceneMode: Cesium.SceneMode.SCENE3D
}); });
viewer.scene.globe.depthTestAgainstTerrain = true; viewer.scene.globe.depthTestAgainstTerrain = true;
//--------------------hover over surfaces-------------------- //--------------------hover over surfaces--------------------
var singleChart = document.getElementById('singleChartContainer'); var singleChart = document.getElementById('singleChartContainer');
var roofViewActivated = false;
//load address //load address
var request = new XMLHttpRequest(); var request = new XMLHttpRequest();
request.onreadystatechange = function(){ request.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200){ if (this.readyState == 4 && this.status == 200) {
var coordinate = JSON.parse(request.responseText); var coordinate = JSON.parse(request.responseText);
var lat = coordinate.results[0].geometry.lat; var lat = coordinate.results[0].geometry.lat;
var lng = coordinate.results[0].geometry.lng; var lng = coordinate.results[0].geometry.lng;
console.log(lat + " " + lng); console.log(lat + " " + lng);
fly(lat, lng); fly(lat, lng);
} }
} }
function searchaddress(){
function searchaddress() {
var query = document.getElementById('SearchAddress').value; var query = document.getElementById('SearchAddress').value;
request.open("GET",'https://api.opencagedata.com/geocode/v1/json?key=c73da14969e6408ab4535b3ad6dc43ea&pretty=1&no_annotations=1&q=' + query, true); request.open("GET", 'https://api.opencagedata.com/geocode/v1/json?key=c73da14969e6408ab4535b3ad6dc43ea&pretty=1&no_annotations=1&q=' + query, true);
request.send(); request.send();
} }
function fly( lat, lng){ function fly(lat, lng) {
var pinBuilder = new Cesium.PinBuilder(); var pinBuilder = new Cesium.PinBuilder();
var bluePin = viewer.entities.add({ var bluePin = viewer.entities.add({
name: "Blank blue pin", name: "Blank blue pin",
position: Cesium.Cartesian3.fromDegrees(lng, lat), position: Cesium.Cartesian3.fromDegrees(lng, lat),
billboard: { billboard: {
image: pinBuilder.fromColor(Cesium.Color.ROYALBLUE, 48).toDataURL(), image: pinBuilder.fromColor(Cesium.Color.ROYALBLUE, 48).toDataURL(),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
}, },
}); });
viewer.zoomTo(bluePin); viewer.zoomTo(bluePin);
viewer.flyTo(bluePin); viewer.flyTo(bluePin);
...@@ -235,7 +237,7 @@ var pickRoofType ...@@ -235,7 +237,7 @@ var pickRoofType
var pickUValue var pickUValue
var shadowHourValue = 0; var shadowHourValue = 0;
var SurfacePvPotential=[]; var SurfacePvPotential = [];
//Color a feature on selection and show metadata in the InfoBox //Color a feature on selection and show metadata in the InfoBox
...@@ -343,7 +345,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { ...@@ -343,7 +345,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
for (const [key, value] of Object.entries(pvPotentialSurfaces)) { //looping threw the shadowdata array for (const [key, value] of Object.entries(pvPotentialSurfaces)) { //looping threw the shadowdata array
if (value["id"] === t.getProperty("gml_id")) { //checking if the ids of the current surface match the id in the shadowdata array if (value["id"] === t.getProperty("gml_id")) { //checking if the ids of the current surface match the id in the shadowdata array
//console.log("hour:",chosenDate.hour); //console.log("hour:",chosenDate.hour);
console.log(value); //console.log(value);
SurfacePvPotential = value["attributes"]["pvPotential"]["totalInvestment"]; SurfacePvPotential = value["attributes"]["pvPotential"]["totalInvestment"];
} }
} }
...@@ -439,7 +441,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) { ...@@ -439,7 +441,7 @@ viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
//Roof View //Roof View
//BUG: shows random attributes ui element ?? //BUG: shows random attributes ui element ??
else if (document.getElementById("roof").checked) { else if (document.getElementById("roof").checked && roofViewActivated) {
console.log("clicked when in roof view and on click"); console.log("clicked when in roof view and on click");
//looping threw all surfaces //looping threw all surfaces
......
...@@ -254,9 +254,10 @@ ...@@ -254,9 +254,10 @@
<div class="lang" key="surfaceview">Surface-View</div> <div class="lang" key="surfaceview">Surface-View</div>
<label class="drinkcard-cc surface" for="surface"></label> <label class="drinkcard-cc surface" for="surface"></label>
<!-- deprecated: Used for roof-view
<input id="roof" type="radio" name="credit-card" value="roof"> <input id="roof" type="radio" name="credit-card" value="roof">
<div class="lang" key="roofview">Roof-View</div> <div class="lang" key="roofview">Roof-View</div>
<label class="drinkcard-cc surface" for="roof"></label> <label class="drinkcard-cc surface" for="roof"></label> -->
</div> </div>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment