generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from amosproj/sprint-08-release
Sprint 08 release
- Loading branch information
Showing
9 changed files
with
209 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,72 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta charset="UTF-8" /> | ||
<title>360 Pano Image Viewer</title> | ||
<link rel="stylesheet" href="css/main.css"> | ||
</head> | ||
<body> | ||
<script src="libs/three.min.js"></script> | ||
<script src="libs/jQuery.min.js"></script> | ||
<script src="libs/ol.js"></script> | ||
|
||
<script type="module"> | ||
import { ViewerWindow } from "./js/viewer/ViewerWindow.js"; | ||
|
||
const getUrlParameter = function getUrlParameter(sParam) { | ||
let sPageURL = window.location.search.substring(1), | ||
sURLVariables = sPageURL.split('&'), | ||
sParameterName; | ||
|
||
for (let i = 0; i < sURLVariables.length; i++) { | ||
sParameterName = sURLVariables[i].split('='); | ||
|
||
if (sParameterName[0].toUpperCase() === sParam.toUpperCase()) { | ||
return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); | ||
} | ||
} | ||
<link rel="stylesheet" href="css/main.css" /> | ||
|
||
return false; | ||
}; | ||
|
||
const onLoadStr = getUrlParameter("onLoad"); | ||
const parts = decodeURIComponent(onLoadStr).split('.'); | ||
|
||
let onLoadFunc = window.parent; | ||
for (let i = 0; i < parts.length; i++) { | ||
try { | ||
onLoadFunc = onLoadFunc[parts[i]]; | ||
} | ||
catch (e) { | ||
onLoadFunc = null; | ||
<script src="libs/three.min.js"></script> | ||
<script src="libs/jQuery.min.js"></script> | ||
<script src="libs/ol.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> | ||
|
||
<!-- Initializing the Viewer with the onload function in the URL --> | ||
<script type="module" defer> | ||
import { ViewerWindow } from './js/viewer/ViewerWindow.js' | ||
|
||
const getUrlParameter = function getUrlParameter(sParam) { | ||
let sPageURL = window.location.search.substring(1), | ||
sURLVariables = sPageURL.split('&'), | ||
sParameterName | ||
|
||
for (let i = 0; i < sURLVariables.length; i++) { | ||
sParameterName = sURLVariables[i].split('=') | ||
|
||
if ( | ||
sParameterName[0].toUpperCase() === sParam.toUpperCase() | ||
) { | ||
return typeof sParameterName[1] === undefined | ||
? true | ||
: decodeURIComponent(sParameterName[1]) | ||
} | ||
} | ||
|
||
if ('function' === typeof(onLoadFunc)) { | ||
onLoadFunc(window, ViewerWindow.viewerAsync); | ||
return false | ||
} | ||
|
||
const onLoadStr = getUrlParameter('onLoad') | ||
const parts = decodeURIComponent(onLoadStr).split('.') | ||
|
||
let onLoadFunc = window.parent | ||
for (let i = 0; i < parts.length; i++) { | ||
try { | ||
onLoadFunc = onLoadFunc[parts[i]] | ||
} catch (e) { | ||
onLoadFunc = null | ||
} | ||
</script> | ||
|
||
<div id="pano-viewer"> | ||
<div id="map" class="map"></div> | ||
|
||
<div class = "control-OL" id="floorOL"> | ||
<div id="cfOL"></div> | ||
<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> | ||
|
||
} | ||
|
||
if ('function' === typeof onLoadFunc) { | ||
onLoadFunc(window, ViewerWindow.viewerAsync) | ||
} | ||
</script> | ||
|
||
</head> | ||
|
||
<body> | ||
<div id="pano-viewer"></div> | ||
|
||
<div id="map" class="map"> | ||
<div class="control-OL" id="floorOL"> | ||
<div id="cfOL"></div> | ||
<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> | ||
</body> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
"use strict"; | ||
|
||
// Event position in viewer | ||
|
||
export class EventPosition { | ||
constructor() { | ||
|
||
this.x; // Number // y coordinate of this image on the floor | ||
|
||
this.y; // Number // y coordinate of this image on the floor | ||
} | ||
|
||
} | ||
|
||
import { ViewerContextItem } from "./ViewerContextItem.js"; | ||
|
||
export class EventLayer { | ||
constructor() { | ||
this.viewer_contex; | ||
this.viewer_contex; | ||
} | ||
vwr_oncontext (xy, location){ | ||
|
||
vwr_oncontext(xy, location) { | ||
//Parameters: | ||
//xy EventPosition: Pointer position | ||
//location THREE.Vector3 : Local coordinates for pointer position+ | ||
viewer_contex = new ViewerContextItem(); | ||
return viewer_contex; | ||
|
||
//Showing pointer location and viewing direction in the terminal: | ||
console.log("xy: ", xy); | ||
console.log("Viewing Direction: ", location); | ||
|
||
//Creating callback function for context menu item: | ||
let callback = function (key, options) { | ||
var msg = 'clicked: ' + key; | ||
(window.console && console.log(msg)) || alert(msg); | ||
}; | ||
|
||
//Creating item objects | ||
let itemEdit = new ViewerContextItem(callback, "edit", null, "Edit"); | ||
let itemCut = new ViewerContextItem(callback, "cut", null, "Cut"); | ||
|
||
//Creating list of item objects. | ||
return [itemEdit, itemCut]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
|
||
//Event position in viewer | ||
export class EventPosition { | ||
constructor(event) { | ||
|
||
this.x = event.clientX; | ||
this.y = event.clientY; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"use strict"; | ||
|
||
export class ViewerContextItem { | ||
|
||
constructor(callback, icon, items, name) { | ||
|
||
//Callback to execute for this context menu item | ||
this.callback = callback; | ||
//Icon class for this context menu item | ||
this.icon = icon; | ||
//Sub items below this context menu item | ||
this.items = items; | ||
//Human readable name of this item in the displayed context menu | ||
this.name = name; | ||
} | ||
} |
Oops, something went wrong.