Skip to content

Commit

Permalink
Merge pull request #124 from amosproj/release-candidate-13
Browse files Browse the repository at this point in the history
Merge release-candidate-13 to main branch
  • Loading branch information
leonopulos authored Jul 13, 2021
2 parents fbc5572 + 56e98e9 commit 41e85ec
Show file tree
Hide file tree
Showing 9 changed files with 205 additions and 147 deletions.
12 changes: 2 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,13 @@
</head>
<body>
<iframe id="amos"></iframe>
<script type="module">
import { TestViewerAPI } from './src/js/viewer/TestViewerAPI.js'

<script>
// Callback function to start viewer via viewerAsync
window.parent = {
callback: function(viewerWindow, viewerAsync) {
console.info("initial callback called:", viewerWindow, viewerAsync);
viewerAsync("https://bora.bup-nbg.de/amos2floors", (api) => {

viewerAsync("../assets/", (api) => {
console.info("loaded callback called with API:", api);

// test the API
const test = new TestViewerAPI(api);
test.addListeners();
//test.eventMeshTest();
});
}
};
Expand Down
4 changes: 0 additions & 4 deletions src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ body {
color: #fff;
}

.map {
background-color: white;
}

.control-OL{
position: fixed;
bottom: 22%;
Expand Down
32 changes: 18 additions & 14 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src="libs/three.min.js"></script>
<script src="libs/jQuery.min.js"></script>
<script src="libs/ol.js"></script>
<script src="libs/ol-ext.min.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.css" />
<script src="libs/contextMenu.min.js"></script>
Expand Down Expand Up @@ -57,20 +58,23 @@
</head>

<body>
<div id="pano-viewer"></div>

<div id="map" class="map">
<div id="menu">
<button id="zoom-in"> + </button>
<button id="zoom-out"> - </button>
<button id="full-screen"> Full Screen </button>
<button id="close-full-screen"> Close Full Screen </button>
</div>
<div class="control-OL" id="floorOL">
<span> Current Floor: </span>
<select name="dropdown-OL" id="dropdown-floors-OL"></select>
<button id="buttonUpOL" class="code">Floor Up</button>
<button id="buttonDownOL" class="code">Floor Down</button>
<div id="full-view">
<div id="pano-viewer"></div>
</div>
<div id="small-view"></div>
<div id="map" class="map">
<div id="menu">
<button id="zoom-in"> + </button>
<button id="zoom-out"> - </button>
<button id="full-screen"> Full Screen </button>
<button id="close-full-screen"> Close Full Screen </button>
</div>
<div class="control-OL" id="floorOL">
<span> Current Floor: </span>
<select name="dropdown-OL" id="dropdown-floors-OL"></select>
<button id="buttonUpOL" class="code">Floor Up</button>
<button id="buttonDownOL" class="code">Floor Down</button>
</div>
</div>
</div>
</body>
Expand Down
4 changes: 2 additions & 2 deletions src/js/viewer/ViewerAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class ViewerAPI {
// localCoords : THREE.Vector3 // Local coordinates used by the viewer
const globalX = this.floor.origin[0] - ((localCoords.x / 1000) / LON_SCALAR);
const globalY = this.floor.origin[1] - ((localCoords.y / 1000) / LAN_SCALAR);
const globalZ = localCoords.z - this.floor.currentFloor.z;
const globalZ = localCoords.z + this.floor.currentFloor.z;

return [globalX, globalY, globalZ];
// Returns: [Number] : WGS 84 coordinates [longitude, latitude, z] (z value is floorZ + panoZ, where localCoords is just the panoZ)
Expand All @@ -157,7 +157,7 @@ export class ViewerAPI {
return new this.THREE.Vector3(
dx * 1000,
dy * 1000,
globalCoords[2] + this.floor.currentFloor.z);
globalCoords[2] - this.floor.currentFloor.z);
}

// TODO: swap() and big(wanted)
Expand Down
2 changes: 1 addition & 1 deletion src/js/viewer/ViewerConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const PLUS_MINUS_ZOOM_SPEED = 5;
//Configurable values to change some aspects of the ViewerMapAPI

// Describes the Field of View of scaling of displayed on the map.
export const SCALING_MAP = 0.2;
export const SCALING_MAP = 0.1;

// Describes the maximum zoom of the map.
export const MAP_ZOOM = 4;
Expand Down
Loading

0 comments on commit 41e85ec

Please sign in to comment.