<?php
global $mydata;
global $count;
global $thecorners;
global $block_corners;
global $block_number;
global $height;
global $bns;
global $block_count;
global $building_count;
global $the_building_list;
global $the_lon_lats;
global $current_date;
global $looklong;
global $looklat;
global $buildingIDs;
global $bldgIDcount;
$host = "localhost";
$user = "saintlouisdev";
$pass = "";
$db = "vcities";
$building_count=0;
function do_query($the_query){
        $host = "localhost";
        $user = "saintlouisdev";
        $pass = "";
         $db = "vcities";
        try {
           $hcon = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass");
           if (!$hcon) {    echo "Could not connect to server\n";  }
           $rs = pg_query($hcon, $the_query) or die("Cannot execute query: $query\n");
            pg_close($hcon);
            return pg_fetch_all($rs,$result_type = PGSQL_NUM);
        } catch (Exception $e) { echo 'Caught exception: '. $e->getMessage(). "\n";}
}


function get_the_heightanddate($bn) {
    $host = "localhost";
    $user = "saintlouisdev";
    $pass = "";
    $db = "vcities";
    //1118_1121_1124
    //echo $db;
    try {
        $hcon = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass");
        if (!$hcon) {
            echo "Could not connect to server\n";
        }
        $query = "select a.height, to_char(a.default_date, 'YYYY-MM-DD') from cesium_entities a, temporal_objects b where b.id=a.temporalobject_ptr_id and a.entity_type=0 and trim(both ' ' from b.block_number)='" . $bn . "'";
        // echo $query;
        $rs = pg_query($hcon, $query) or die("Cannot execute query: $query\n");
        pg_close($hcon);
        $row = pg_fetch_row($rs);
        return $row;
        // echo $height;
    } catch (Exception $e) {
        echo 'Caught exception: ', $e->getMessage(), "\n";
    }
}



try {
  //  $block_count=$argc-1;
  // $bns = array(1122);
  //$block_count=1;
 $bns = explode("_",$_GET["the_block"]);
 $block_count=count($bns);
   
  //  for ($ind = 0;$ind<$block_count;$ind++)$bns[$ind] = $argv[$ind+1];
    for ($ib = 0; $ib < $block_count; $ib++) {
        $height_currentdate = get_the_heightanddate($bns[$ib]);
        $height[$ib] = $height_currentdate[0];
        $current_date[$ib] = $height_currentdate[1];
    }
    $con = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass");
    if (!$con) {
        echo "Could not connect to server\n";
    }
    $the_clause = 'b.block_number=' . "'" . $bns[0] . "' ";
    for ($ib = 1; $ib < $block_count; $ib++) {
        $the_clause = $the_clause . 'or b.block_number=' . "'" . $bns[$ib] . "' ";
    }
    $the_clause = ' (' . $the_clause . ') ';
    $query1 = 'SELECT  b.block_number, a.building_id, c.value, c.is_valid, d.value, d.is_valid, a.points,e.ge_latitude,e.ge_longitude FROM saintlouisdev.geo_footprints a,  saintlouisdev.temporal_objects b, saintlouisdev.vc_dates c, saintlouisdev.vc_dates d,CesiumLatLong e  WHERE ' . $the_clause;
    $query2 = ' AND a.temporalobject_ptr_id=b.id  AND b.start_date_id=c.id AND b.end_date_id=d.id AND e.building_id=a.building_id;';
    $query = $query1 . $query2;
    $rs = pg_query($con, $query) or die("Cannot execute query: $query\n");
    pg_close($con);
    $i = 0;
    while ($row = pg_fetch_row($rs)) {
        //  $justpoints=substr($row[6],9);
        $tok1 = strtok(substr($row[6], 9), " ");
        $tok2 = strtok(" ");
        for ($j = 0; $j < 5; $j++) {
            $mydata[$i][$j] = $row[$j + 1];
        }
        $mydata[$i][5] = $tok1;
        $mydata[$i][6] = $tok2;
        $mydata[$i][7] = $row[7];
        $mydata[$i][8] = $row[8];;
        $i++;
    }
    $count = $i;
    $con = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass")
    or die("Could not connect to server\n");
    $query1 = 'select a.points from geo_blocks a ,temporal_objects b WHERE ';
    $query2 = ' and a.temporalobject_ptr_id=b.id';
    $query = $query1 . $the_clause . $query2;
//echo $query.'
'; $rs = pg_query($con, $query) or die("Cannot execute query: $query\n"); pg_close($con); for ($ib = 0; $ib < $block_count; $ib++) { $row = pg_fetch_row($rs); $tok1 = strtok(substr($row[0], 9), " "); $tok2 = strtok(" "); $output = shell_exec('java toLatLon ' . $tok1 . ' ' . $tok2); $ind = strrpos($output, ' '); $lat = substr($output, 0, $ind); $lon = substr($output, ($ind + 1), -1); $thecorners[$ib] = $lon . ',' . $lat; $firstcorner = $thecorners[$ib]; for ($i = 0; $i < 3; $i++) { $tok1 = strtok(","); $tok1 = strtok(" "); $tok2 = strtok(" "); $output = shell_exec('java toLatLon ' . $tok1 . ' ' . $tok2); $ind = strrpos($output, ' '); $lat = substr($output, 0, $ind); $lon = substr($output, ($ind + 1), -1); $thecorners[$ib] = $thecorners[$ib] . ',' . $lon . ',' . $lat; } $thecorners[$ib] = $thecorners[$ib] . ',' . $firstcorner; // echo $thecorners[$ib]."\n"; } } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } ?> <!doctype html> <html lang="en"> <head> <base href="http://vcities.umsl.edu/Cesium1.54/Apps/Sandcastle/vcities/"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <title>Virtual Cities</title> <script src="../../../Build/Cesium/Cesium.js"></script> <script type="text/javascript" src="../Sandcastle-header.js"></script> <script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> <script type="text/javascript" src="./vcities.js"> </script> <script type="text/javascript" src="./oldervcities.js"> </script> <script type="text/javascript"> if (typeof require === "function") { require.config({ baseUrl : '../../../Source', waitSeconds : 120 }); } //<script> function loadconfirm(the_selected) { // parent.frames['Big'].location.href=links[the_selected.id]; } </script> <style> @import url(../../../Build/Cesium/Widgets/widgets.css); html, body, #cesiumContainer { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; } .toolbar-left { display: block; position: absolute; top: 5px; left: 5px; } .button1 { background-color: #000000; border: 2px; color: white; opacity: 0.7; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; } .button2 { background-color: rgba(0, 0, 0, 0.7); border: 2px; color: white; opacity: 1.0; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; } .slider_text{ background-color: #000000; color: red; font-size: 16px; border: 2px; text-align: center } </style> </head> <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> <style> @import url(../templates/bucket.css); </style> <div id="cesiumContainer" class="fullSize"> </div> <div id="loadingOverlay"> <h1>Loading...</h1> </div> <div id="toolbar"> </div> <script id="cesium_sandcastle_script"> function startup(Cesium) { 'use strict'; //Sandcastle_Begin gCesium=Cesium; Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjZjRjMjQ1OS1hNDI4LTQ0NmYtYTczYy03NGQ3NjMzYTVjZDYiLCJpZCI6NDY0OSwic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU0MTM2MDM4OH0.NCvTrd2_i3tadjyL-jr1ZN4Y4VbwydskfwWefpx-xJk'; Cesium.BingMapsApi.defaultKey = 'AlsRfxEEzUjJ53TQRoLDuTcGN4S_tAbGsUNB7CcG74aCx01tldXKEYw5-Df7eOz5'; //var viewer = new Cesium.Viewer( 'cesiumContainer'); var viewer = new Cesium.Viewer('cesiumContainer',{ infoBox : true}); gviewer=viewer; var options = { camera : viewer.scene.camera, canvas : viewer.scene.canvas }; ////////////////////////// viewer.scene.canvas.addEventListener('click', function(e){ loadconfirm(viewer.selectedEntity); // gecl(viewer.selectedEntity); console.log(gviewer.camera.heading); console.log(find_bldg_index()); parent.SiteClick(gviewer.selectedEntity.description); if(first_click){ first_click=false; }else{ selected_holder.description=description_holder; } selected_holder=gviewer.selectedEntity; description_holder=gviewer.selectedEntity.description; if(!in_fullC){ console.log("not full C"); selected_holder.description=""; gviewer.selectedEntity=selected_holder; } }); /////////////////////////////// viewer.scene.globe.depthTestAgainstTerrain = true; <?php $bns = explode("_",$_GET["the_block"]); $block_count=count($bns); $host = "localhost"; $user = "saintlouisdev"; $pass = ""; $db = "vcities"; $block_number=$bns[0]; $start_date="1800-01-01"; $end_date="1950-01-01"; $temporalobject_ptr_id=0; $bldgIDcount=0; $the_header; function tweak_query($the_tweak){ $host = "localhost"; $user = "saintlouisdev"; $pass = ""; $db = "vcities"; if($the_tweak==1){ $the_query = "select bldg_number, model, block_number,heading from cesiumtweaks where tweak=1"; }else{ $the_query = "select bldg_number, model, block_number,lon,lat,heading,tweak from cesiumtweaks where tweak=2"; } try { $hcon = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass"); if (!$hcon) { echo "Could not connect to server\n"; return; } $rs = pg_query($hcon, $the_query) or die("Cannot execute query: $query\n"); pg_close($hcon); return pg_fetch_all($rs,$result_type = PGSQL_NUM); } catch (Exception $e) { echo 'Caught exception: '. $e->getMessage(). "\n";} } /////////////////// $this_array=tweak_query(1); $max = count($this_array); for ($j = 0; $j < ($max-1);$j++) { $this_block_number=$this_array[$j][2]; $the_header=$this_array[$j][3]; $this_model=$this_array[$j][1]; $in_the_block=0; for ($i= 0; $i< ($block_count); $i++) { if ($this_block_number==$bns[$i]) $in_the_block=1; }; if ($in_the_block==1) { $building_id=$this_array[$j][0]; // $the_header=$this_array[$j][3]; $buildingIDs[$bldgIDcount]=$building_id; $bldgIDcount++; $query1 ='SELECT a.building_id,a.ge_latitude,a.ge_longitude,a.ge_heading,b.title, b.narrative,b.caption,a.temporalobject_ptr_id FROM saintlouisdev.geo_meshes a,saintlouisdev.the_histories b ' ; $query2 ='where a.building_id='.$building_id.' and b.temporal_object_id='.$building_id; $query = $query1. $query2; $con = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass"); if (!$con) { echo "Could not connect to server\n"; } $rs = pg_query($con, $query) or die("Cannot execute query: $query\n"); pg_close($con); $row = pg_fetch_row($rs); if ( $row==NULL) { $query ='SELECT building_id,ge_latitude,ge_longitude,ge_heading,temporalobject_ptr_id FROM saintlouisdev.geo_meshes where building_id='.$building_id; $con = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass"); if (!$con) { echo "Could not connect to server\n"; } $rs = pg_query($con, $query) or die("Cannot execute query: $query\n"); pg_close($con); $row = pg_fetch_row($rs); $narrative="no history available"; $the_name="not known"; $temporalobject_ptr_id=$row[4]; } else { $narrative=str_replace("'","'",$row[5]); $narrative = str_replace("http://12.234.174.20","http://vcities.umsl.edu",$narrative); $narrative = str_replace("http://vcities.ite-stl.org","http://vcities.umsl.edu",$narrative); $description="'<html><body><center><h2>".$row[4]."</h2><h3>Building ".$row[0]."</h3></center>".$narrative."<body></html>'"; $description= str_replace("\r", "", $description); $description = str_replace("\n", "", $description); $temporalobject_ptr_id=$row[7]; $the_name=$row[4]; } $the_lon=$row[2]; $the_lat=$row[1]; $the_head=$row[3]; $the_id=$row[0]; $query1="SELECT a.id, a.description, b.value,c.value FROM saintlouisdev.temporal_objects a, saintlouisdev.vc_dates b, saintlouisdev.vc_dates c where "; $query2=" a.id=".$temporalobject_ptr_id." and a.start_date_id=b.id and a.end_date_id=c.id"; $query=$query1.$query2; $con = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass"); if (!$con) { echo "Could not connect to server\n"; } $rs = pg_query($con, $query) or die("Cannot execute query: $query\n"); pg_close($con); $row = pg_fetch_row($rs); $start_date=$row[2]; $end_date=$row[3]; $description="'<html><body><center><h2>".$row[1]."</h2></center>".$narrative."<body></html>'"; $description= str_replace("\r", "", $description); $description = str_replace("\n", "", $description); echo "var position=Cesium.Cartesian3.fromDegrees(".$the_lon.",".$the_lat.",0.0);\n"; //position = Cesium.Cartesian3.fromDegrees(-90.18415135202939,38.624735103,0); $this_head=$the_head; if ( $the_header != "361" ) { $this_head=$the_header; } echo "var heading = Cesium.Math.toRadians(".$this_head.");\n"; echo "var roll=0.0;\n"; echo "var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);\n"; echo "var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);\n"; echo "var building".$the_id." = viewer.entities.add({\n"; echo ' id:'.$the_id.",\n"; echo ' name:"'.$the_name.'",'."\n"; echo " description:".$description.",\n"; echo ' availability : new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({'."\n"; echo ' start : Cesium.JulianDate.fromIso8601("'.$start_date.'")'.",\n"; echo ' stop : Cesium.JulianDate.fromIso8601("'.$end_date.'")'.",\n"; echo ' })]),'."\n"; echo " position: position,\n"; echo " orientation: orientation,\n"; echo ' model:{'; echo ' uri:"./models/block_8/'. $this_model.'"'."\n"; echo " }\n"; echo " }\n"; echo " );\n"; echo 'all_buildings.push(building'.$the_id.'); <!--This Buildings index='.$building_count." --> \n"; $building_count++; echo 'lon_lat_heights["building'.$the_id.'"]=['.$the_lon.','.$the_lat.',0.0];'."\n"; echo 'bldg_lon_lats.push(['.$the_lon.','.$the_lat.']);'."\n"; echo 'positions.push(Cesium.Cartographic.fromDegrees('.$the_lon.','.$the_lat.'));'."\n"; } } $the_tweaks=tweak_query(2); $tmax=count($the_tweaks); $buildinglist = array(); $lon_lats = array(); $j = 0; echo "\n"; for ($i = 0; $i < $count; $i++) { $bldg = $mydata[$i][0]; $bldg_inlist=FALSE; for ($bldid=0;$bldid<$bldgIDcount;$bldid++) { if ($buildingIDs[$bldid]==$bldg) $bldg_inlist=TRUE; if ($bldg_inlist)break; } if (!$bldg_inlist) { $buildingIDs[$bldgIDcount]=$bldg;$bldgIDcount++; $this_url = $bldg + 2; $link = './models/all/' . $this_url . '.gltf'; if (file_exists($link)) { $query1="SELECT a.title, a.narrative FROM saintlouisdev.the_histories a, saintlouisdev.the_buildings b "; $query2="where a.temporal_object_id=b.building_id AND b.building_id=".$bldg; $query=$query1.$query2; $con = pg_connect("host=$host dbname=$db port=5432 user=$user password=$pass"); $rs = pg_query($con, $query) or die("Cannot execute query: $query\n"); $rows = pg_fetch_all($rs); pg_close($con); $narrative=""; $description='<html><body><center><h4>Building '.$bldg.'</h4></center><body></html>'; if (count($rows)==1) { $title=str_replace("\n", "",$rows[0]['title']); $title=str_replace("'","'",$title); $narrative=str_replace("'","'",$rows[0]['narrative']); // $narrative=$rows[0]['narrative']; $description='<html><body><center><h4>'.$title.'</h4><h5>Building '.$bldg.'</h5></center>'.$narrative.'<body></html>'; $description= str_replace("\r", "", $description); $description = str_replace("\n", "", $description); } $istweeked=array(0,0); for($j=0;$j<$tmax;$j++){ if($bldg==$the_tweaks[$j][0]){ $istweeked=array(1,$j); $mydata[$i][8]=$the_tweaks[$j][3]; $mydata[$i][7]=$the_tweaks[$j][4]; } } echo "var position=Cesium.Cartesian3.fromDegrees(".$mydata[$i][8] .",".$mydata[$i][7] .",0.0);\n"; if($istweeked[0]==1){ echo "var heading = Cesium.Math.toRadians(".$the_tweaks[$istweeked[1]][5] .");\n"; echo "var roll=0.0;\n"; echo "var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);\n"; echo "var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);\n"; $link = "./models/all/".$the_tweaks[$istweeked[1]][1]; } echo "var building" . $bldg . " = viewer.entities.add({\n"; echo ' id:' . $bldg .",\n"; echo ' name:"Building ' . $bldg . '",' . "\n"; echo ' description:'."'".$description ."',". "\n"; echo " availability : new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({\n"; echo ' start : Cesium.JulianDate.fromIso8601("' . $mydata[$i][1] . '"),' . "\n"; echo ' stop : Cesium.JulianDate.fromIso8601("' . $mydata[$i][3] . '")' . "\n"; echo " })]),\n"; echo " position: position,\n"; if($istweeked[0]==1){ echo " orientation: orientation,\n"; } echo " model:{uri:'".$link . "'" ."}\n"; echo " }\n"; echo " );\n"; // echo 'building'.$bldg.'.description='.'"This is Building '.$bldg.'"'.";\n"; echo 'building_list[' . $j . ']=building' . $bldg . ";\n"; $buildinglist[$j] = 'building' . $bldg; $lon_lats[$buildinglist[$j]] = preg_replace("/\r|\n/", "", $mydata[$i][8]) . ',' . $mydata[$i][7]; echo 'all_buildings.push(building'.$bldg.'); <!--This Buildings index='.$building_count." --> \n"; $building_count++; echo 'lon_lat_heights["' . $buildinglist[$j] . '"]=[' . $lon_lats[$buildinglist[$j]] . ',' . $height[0] . "];\n"; echo 'bldg_lon_lats.push(['.$mydata[$i][8] . ',' . $mydata[$i][7].']);'."\n"; echo "positions.push(Cesium.Cartographic.fromDegrees(" . $mydata[$i][8] . ',' . $mydata[$i][7] . "));\n"; $j++; } } } $count = $j; $the_building_list = $buildinglist; $the_lon_lats = $lon_lats; echo 'bldg_count=' . $count . ";\n"; // echo 'viewer.clock.currentTime =Cesium.JulianDate.fromIso8601("' . $current_date[0] . '");' . "\n"; echo 'viewer.clock.currentTime =Cesium.JulianDate.fromIso8601("1900-01-01T00:00:00Z");' . "\n"; ?> /////////////////////////////////////////////////// // Set up clock and timeline. viewer.clock.shouldAnimate = false; // make the animation play when the viewer starts viewer.clock.startTime = Cesium.JulianDate.fromIso8601("1830-01-01T00:00:00Z"); viewer.clock.stopTime = Cesium.JulianDate.fromIso8601("2000-01-01T00:00:00Z"); viewer.clock.multiplier = 1; // sets a speedup viewer.timeline.zoomTo(viewer.clock.startTime, viewer.clock.stopTime); // set visible range viewer.clock.currentTime = Cesium.JulianDate.fromIso8601("1930-01-01T00:00:00Z"); // lookAt lheading=270.;llong=-90.18527699999999;llat=38.624388;lpitch=-10.0; infopage="http://www.citytoriver.org/history/"; elong=bldg_lon_lats[0][0];nlat=bldg_lon_lats[0][1];wlong=bldg_lon_lats[0][0];slat=bldg_lon_lats[0][1]; compute_nsc_long_lat(); center = Cesium.Cartesian3.fromDegrees( clong,clat ); //-90.21437530335254,38.637056502179554); heading = Cesium.Math.toRadians(-10.0); lheading=heading; pitch = Cesium.Math.toRadians(-10.0); if(crange<100.0)crange=100.0; range = 1.2*crange; startheading=heading;startpitch=pitch;startrange=range;startcenter=center; viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range)); //Sandcastle_End Sandcastle.finishedLoading(); box_it(); } if (typeof Cesium !== "undefined") { startup(Cesium); } else if (typeof require === "function") { require(["Cesium"], startup); } </script> <div class="toolbar-left"> <table> <tr><td><button class="button1" onclick="loop_it();">Loop Site</button></td><td> <button class="button1" onclick="open_div();">Open Document View</button></td><td> <font class="button2"><b>Present Range </b> <span id="range_value"><script>document.write(Math.round(1.7*crange));</script></span><b> Meters</b></font></td><td> </td></tr> <tr><td><button class="button1" onclick="stop_loop();">  Pause  </button></td> <td> <!-- select class="button2" id="WhereTo" onchange="gothere()"> <option value="0"><b><font color="yellow">Notable Buildings</font></b></option> <option value="3"><b>The Old Rock House</b></option> <option value="2"><b>The Old Rock House-1845</b></option> <option value="16"><b>Federal Fur & Wool</b></option> <option value="-1"><b><font color="yellow">Overview</font</b></option> </select --></td> <td> <input type="range" min="50" max="250" value="150" class="button1" id="myRange"></td></tr> </table> </div> <script> var slider = document.getElementById("myRange"); slider.oninput = function() { var this_heading=gviewer.camera.heading; var this_pitch=gviewer.camera.pitch; range=slider.value; gviewer.camera.lookAt(center, new gCesium.HeadingPitchRange(this_heading, this_pitch, range)); document.getElementById("range_value").innerHTML = range; } function gothere() { var e = document.getElementById("WhereTo"); var the_bldg = e.options[e.selectedIndex].value; var the_target=all_buildings[the_bldg]; console.log(the_bldg); if (the_bldg==-1) { heading=7.0; lheading=heading; range=171.0; document.getElementById("myRange").value=range; document.getElementById("range_value").innerHTML = range; center=Cesium.Cartesian3.fromDegrees( clong,clat ); gviewer.selectedEntity=null; gviewer.clock.currentTime =Cesium.JulianDate.fromIso8601("1900-01-01T00:00:00Z"); gviewer.camera.lookAt(startcenter, new gCesium.HeadingPitchRange(startheading, startpitch, startrange)); parent.SiteClick("Start"); first_click=true; in_fullC=true; selected_holder=null; parent.full_screen1(); } else { gviewer.selectedEntity=the_target; parent.SiteClick(the_target.description); if (first_click) { first_click=false; } else { selected_holder.description=description_holder; } selected_holder=the_target; description_holder=the_target.description; if (!in_fullC) { console.log("not full C"); selected_holder.description=""; gviewer.selectedEntity=selected_holder; } if (the_bldg==3) { heading=4.905037599462777; lheading=heading; range=88.0; document.getElementById("myRange").value=range; document.getElementById("range_value").innerHTML = range; center=Cesium.Cartesian3.fromDegrees(-90.18414,38.624723,0.0); gviewer.clock.currentTime =Cesium.JulianDate.fromIso8601("1900-01-01T00:00:00Z") } else if (the_bldg==16) { heading=1.7957796260818064; lheading=heading; range=171.0; document.getElementById("myRange").value=range; document.getElementById("range_value").innerHTML = range; center=Cesium.Cartesian3.fromDegrees(-90.1849248503835,38.6247988064905,0.0); gviewer.clock.currentTime =Cesium.JulianDate.fromIso8601("1900-01-01T00:00:00Z"); } else if (the_bldg==2) { heading=4.905037599462777; lheading=heading; range=88.0; document.getElementById("myRange").value=range; document.getElementById("range_value").innerHTML = range; center=Cesium.Cartesian3.fromDegrees(-90.18414,38.624723,0.0); gviewer.clock.currentTime =Cesium.JulianDate.fromIso8601("1845-01-01T00:00:00Z"); } gviewer.camera.lookAt(center, new gCesium.HeadingPitchRange(heading, pitch, range)); } } </script> <script> document.getElementById("myRange").min=20; document.getElementById("myRange").max=3*crange; document.getElementById("myRange").value=1.7*crange; function mySpareFunction() { document.getElementById("tester").value=2+1; } </script> </body> </html>