remove unused copy of CaveView in troggle and updated cave.html

template for caveview2
This commit is contained in:
Expo on server 2023-04-29 22:46:14 +01:00
parent 8aec40f951
commit 73af227fb3
26 changed files with 6 additions and 95912 deletions

View File

@ -1,164 +0,0 @@
From: <Saved by Blink>
Snapshot-Content-Location: https://aardgoose.github.io/CaveView.js/installation.html
Subject: CaveView installation
Date: Sun, 24 Oct 2021 15:46:19 -0000
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----MultipartBoundary--eCFBXfFmJiPIUIDdJDuaiHRJfZ59xqA99QxmIcmsBZ----"
------MultipartBoundary--eCFBXfFmJiPIUIDdJDuaiHRJfZ59xqA99QxmIcmsBZ----
Content-Type: text/html
Content-ID: <frame-F25506009C17180F1D15EDA63865EFC8@mhtml.blink>
Content-Transfer-Encoding: quoted-printable
Content-Location: https://aardgoose.github.io/CaveView.js/installation.html
<!DOCTYPE html><html xmlns=3D"http://www.w3.org/1999/xhtml" xml:lang=3D"en-=
gb" lang=3D"en-gb" dir=3D"ltr"><head><meta http-equiv=3D"Content-Type" cont=
ent=3D"text/html; charset=3DUTF-8">
<title>CaveView installation</title>
=09
<link type=3D"text/css" href=3D"https://aardgoose.github.io/CaveView.js/do=
c.css" rel=3D"stylesheet">
</head>
<body>
<h1>Cave View - installation instructions - V2 API</h1>
<h2>Install CaveView files</h2>
<p>A zip archive containing the required files for the latest release are =
<a href=3D"https://github.com/aardgoose/CaveView.js/releases">here</a>.</p>
<p>There is no need to build the JavaScript application from source files =
unless you would like to modify the application.</p>
<p>Unzip the archive in a convenient location on your web server </p>
<h2>Using in a web page</h2>
<p>CaveView requires two files to be included in the page. Replace the plac=
eholder %path% with the path to the unzipped files on the server in the fol=
lowing examples.</p><p>
</p><h3>caveview.css</h3>
<p>The side panel interface and on screen indicators are styled with cavevi=
ew.css. Include this in the <strong>head</strong> section of the page.</p>
<pre> &lt;link type=3D"text/css" href=3D"%path%/CaveView/css/caveview.css" =
rel=3D"stylesheet" /&gt;</pre>
<h3>CaveView.js</h3>
<p>The CaveView application is provided in one javascript file. Include thi=
s in the <strong>body</strong> section of the page. <strong>NOTE: The filen=
ame has changed for the V2 API.</strong></p>
<pre> &lt;script type=3D"text/javascript" src=3D"%path%/CaveView/js/CaveVie=
w2.js" &gt;&lt;/script&gt;</pre>
<h3>Add a container element</h3>
<p>Add an empty block element to the page, with a suitable <strong>id</stro=
ng> attribute. This contains the application, and be sized as required. For=
example a <strong>div</strong> element:</p>
<pre>&lt;div id=3D'% element-id %' &gt;&lt;/div&gt;</pre>
<h3>Create a script to run the application</h3>
<p>The application can be loaded using javascript, typically using an load =
event handler. Replace the placeholder %...% elements with values appropria=
te for your site.</p>
<pre>&lt;script type=3D"text/javascript" &gt;
function onLoad () {
// display the user interface - and a blank canvas
// the configuration object specifies the location of CaveView, surveys a=
nd terrain files
var viewer =3D new CV2.CaveViewer( '% element-id %', {
home: '% location of the unzipped CaveView directory on the survey %',
surveyDirectory: '% location of the survey files on the server %',
terrainDirectory: '% location of the terrain files on the server %'
} );
// if using the full user interface (UI)
var ui =3D new CV2.CaveViewUI( viewer );
// load a single survey to display
ui.loadCave( '% survey filename %' );
// or without the user interface
viewer.loadCave( '% survey filename %' );
}
&lt;/script&gt;
</pre>
<p>alternatively provide a list of surveys to display, by replacing the loa=
dCave() function call with loadCaveList() :</p>
<pre> ui.loadCaveList( [ '% survey filename 1 %', '% survey filename 2 %', =
'% survey filename 3 %' ] );
</pre>
<p>This can be automatically executed on page load by including a page load=
handler in the page <strong>body</strong> tag:</p>
<pre>&lt;body onload=3D"onload();" &gt;</pre>
<p>CaveView should now display when the page is viewed.</p>
<p>The example files included demonstrate using multiple viewers on a page,
changing the default view settings and altering the appearance of the viewe=
r.</p>
<h3>Removal</h3>
<p>To remove the viewer from a page and reclaim memory used promptly:</p>
<pre> ui.dispose();
ui =3D null;
viewer =3D null;
</pre>
<p>Or if not using the UI, just the viewer:</p>
<pre> viewer.dispose();
viewer =3D null;
</pre>
</body></html>
------MultipartBoundary--eCFBXfFmJiPIUIDdJDuaiHRJfZ59xqA99QxmIcmsBZ----
Content-Type: text/css
Content-Transfer-Encoding: quoted-printable
Content-Location: https://aardgoose.github.io/CaveView.js/doc.css
@charset "utf-8";
h1, h2 { margin: 0px 16px 1em; }
h3, h4, h5, p, pre, dl { margin-left: 32px; margin-right: 32px; }
h2 { border-bottom: 2px solid gray; }
h3 { color: navy; }
h4 { margin-top: 2em; background-color: rgb(238, 238, 238); padding: 3px 2p=
x 1px; }
* { font-family: sans-serif; }
pre { font-family: monospace; font-weight: bold; background-color: rgb(238,=
238, 238); padding: 8px; }
dd > span { display: inline-block; padding: 0px 2px; margin-right: 5px; bac=
kground: rgb(238, 238, 238); }
dd > span::before { content: "["; }
dd > span::after { content: "]"; }
dt { margin-bottom: 0.5em; font-weight: bold; color: rgb(102, 102, 102); pa=
dding-left: 16px; }
dd { margin-bottom: 1em; }
------MultipartBoundary--eCFBXfFmJiPIUIDdJDuaiHRJfZ59xqA99QxmIcmsBZ------

View File

@ -1,403 +0,0 @@
body {
margin: 0;
padding: 0;
font-family: 'Source Sans Pro Regular','Helvetica Neue',Helvetica,Arial,sans-serif;
}
div.cv-panel {
position: absolute;
top: 0;
left: 0;
z-index: 100;
background-color: rgba(50,50,50,0.5);
color: yellowgreen;
border: 1px solid black;
border-radius: 5px;
}
div.cv-compass, div.cv-ahi {
position: absolute;
bottom: 95px;
right: 5px;
margin: 0;
padding-top: 2px;
/* border: 1px solid white; */
text-align: center;
width: 78px;
height: 19px;
z-index: 50;
background-color: rgba(50,50,50,0.5);
background-color: black;
color: white;
}
div.cv-ahi {
right: 95px;
}
div.scale-legend {
position: absolute;
color: white;
background-color: black;
bottom: 30px;
}
div.linear-scale {
position: absolute;
color: white;
background-color: black;
right: 30px;
width: 40px;
padding: 2px 0;
text-align: right;
border: 1px solid black;
font-size: 14px;
}
div.linear-scale-caption {
position: absolute;
color: white;
background-color: black;
right: 5px;
width: 65px;
padding: 2px 0 5px 0;
text-align: left;
border: 1px solid black;
font-size: 14px;
}
#min-div {
border-bottom: 1px solid white;
}
#max-div {
border-top: 1px solid white;
}
#angle-legend {
position: absolute;
width: 80px;
right: 5px;
bottom: 180px;
color: white;
background-color: black;
font-size: 14px;
text-align: center;
}
#scene {
width: 100%;
height: 700px;
position: relative;
}
#progress-bar {
position: absolute;
top: 55%;
height: 20px;
border: 1px solid white;
z-index: 100;
}
#status-text {
position: absolute;
top: 50%;
height: 20px;
padding-left: 4px;
background-color: black;
color: white;
z-index: 100;
}
#frame div.page ul {
list-style-type: none;
margin: 8px 0 0 0;
padding: 0;
width: 200px;
height: 100%;
cursor: default;
font-size: 12px;
overflow-y: auto;
overflow-x: hidden;
}
#frame div.page li {
position: relative;
margin-left: 16px;
border-bottom: 1px solid #444444;
}
#frame div.page li.selected {
color: #1ab4e5;
}
#frame div.page li:hover {
color: yellow;
}
#frame div.page div#ui-path {
font-size: 12px;
border-top: 1px solid grey;
border-bottom: 1px solid grey;
margin-top: 8px;
padding: 2px 0 2px 12px;
}
#frame div.page div#ui-path span {
color: #1ab4e5;
}
#frame div.page div.slide {
position: absolute;
top: 64px;
left: 0px;
height: auto;
margin-top:0;
bottom: 44px;
background-color: #222222;
transition: transform 0.25s ease-in;
}
#frame div.slide-out {
border-right: 1px grey solid;
transform: translateX(-100%);
}
#frame div.page div.descend-tree {
position: absolute;
top: 0px;
right: 0px;
margin: 0;
color: #1ab4e5;
z-index: 110;
}
#frame {
position: absolute;
top: 0px;
left: 0px;
width: 240px;
height: 100%;
background-color: transparent;
transform: translateX(-200px);
transition: transform 0.25s ease-in;
}
#frame.onscreen {
transform: none;
transition: transform 0.25s ease-out;
}
#frame a.download {
border: 1px solid green;
display: block;
width: 180px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 4px;
margin-left: 8px;
border: none;
border-bottom: 4px solid #1ab4e5;
color: #dddddd;
background-color: black;
padding-bottom: 4px;
box-shadow: 1px 1px 8px 0px #888888;
outline: none;
text-decoration: none;
text-align: center;
}
#frame a.download:hover {
color: white;
}
#frame a.download:active {
color: #dddddd;
border-bottom: 4px solid #0c536a;
box-shadow: none;
box-shadow: inset 1px 1px 8px 0px #888888;
}
#frame .tab {
position: absolute;
right: 0px;
width: 40px;
height: 40px;
box-sizing: border-box;
background-color: #444444;
border-left: 1px solid black;
background-position: center;
border-top: 1px solid black;
}
#frame #close {
position: absolute;
right: 40px;
bottom: 0px;
width: 40px;
height: 40px;
box-sizing: border-box;
z-index: 150;
background-image: url(../images/ic_remove.png);
background-position: center;
}
#icon_settings {
background-image: url(../images/ic_settings.png);
}
#icon_terrain {
background-image: url(../images/ic_terrain.png);
}
#icon_explore {
background-image: url(../images/ic_explore.png);
}
#icon_info {
background-image: url(../images/ic_info.png);
}
#icon_route {
background-image: url(../images/ic_route.png);
}
#icon_help {
background-image: url(../images/ic_help.png);
}
#frame div.toptab {
background-color: #222222;
border-left: none;
border-right: 1px solid grey;
border-top: 1px solid grey;
}
#frame div.page {
position: absolute;
top: 0px;
bottom: 40px;
left: 0px;
width: 200px;
height: 100%;
color: white;
background-color: #222222;
padding: 0 4px;
box-sizing: border-box;
cursor: default;
padding-bottom: 40px;
}
#frame div.page div.header {
margin: 16px 0px 8px 0px;
font-weight: bold;
height: 16px;
box-sizing: border-box;
padding-left: 2px;
}
#frame div.page div.control {
margin: 2px 0 2px 0;
padding-top: 2px;
}
#frame div.page label {
display: block;
border-top: 1px solid grey;
padding: 2px 0 2px 8px;
font-size: 12px;
}
#frame div.page select {
display: block;
width: 180px;
box-sizing: border-box;
padding-top: 2px;
margin: 2px 0 4px 8px;
}
#frame div.page select:empty {
background-color: #888888;
}
#frame div.page button {
display: block;
width: 180px;
box-sizing: border-box;
margin-top: 4px;
margin-bottom: 4px;
margin-left: 8px;
border: none;
border-bottom: 4px solid #1ab4e5;
color: #dddddd;
background-color: black;
padding-bottom: 4px;
box-shadow: 1px 1px 8px 0px #888888;
outline: none;
}
#frame div.page button:hover {
color: white;
}
#frame div.page button:active {
color: #dddddd;
border-bottom: 4px solid #0c536a;
box-shadow: none;
box-shadow: inset 1px 1px 8px 0px #888888;
}
#frame div.page input[type="text"] {
display: block;
width: 180px;
box-sizing: border-box;
margin-top: 2px;
margin-left: 8px;
}
#frame div.page input[type="checkbox"] {
position: absolute;
right: 0px;
}
#frame div.page input[type="range"] {
display: block;
width: 180px;
margin-left: 8px;
}
#frame dt, #frame dd {
font-size: 12px;
}
#frame dt {
clear: both;
float: left;
padding-left: 16px;
}
#frame dd {
margin-left: 40px;
}
#frame p {
font-size: 12px;
line-height: 18px;
}
div.station-info {
position: absolute;
border: 1px solid white;
background-color: #222222;
color: white;
padding: 4px;
z-index: 200;
}
.overlay-branding {
color: white;
margin: 4px;
position: absolute;
right: 0;
top: 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,35 +0,0 @@
function BGSTileURL ( x, y, z ) {
var earthRadius = 6378137; // in meters
var tileCount = Math.pow( 2, z );
var tileSize = earthRadius * 2 * Math.PI / tileCount;
var x1, x2, y1, y2;
x = x - tileCount / 2;
y = tileCount / 2 - y;
x1 = x * tileSize;
y1 = y * tileSize;
x2 = x1 + tileSize;
y2 = y1 + tileSize;
var url = 'https://map.bgs.ac.uk/arcgis/services/BGS_Detailed_Geology/MapServer/WMSServer?REQUEST=GetMap&VERSION=1.3.0&LAYERS=BGS.50k.Bedrock&STYLES=default&FORMAT=image/png&CRS=EPSG:3857&WIDTH=450&HEIGHT=450';
var bbox = '&BBOX=' + x1 + ',' + y1 + ',' + x2 + ',' + y2;
console.log( 'BGS: ', bbox );
// var img = document.createElement( 'img' );
// img.src = url + bbox;
// img.crossOrigin = '';
// document.body.appendChild( img );
return url + bbox;
}

View File

@ -1,129 +0,0 @@
/*
* BingProvider.js (c) Angus Sawyer, 2017.
*/
function BingProvider ( imagerySet ) {
this.urlTemplate = null;
this.subdomains = [];
this.subdomainIndex = 0;
this.subdomainCount = 0;
this.minZoom = null;
this.maxZoom = null;
var self = this;
var metadata;
var uriScheme = window.location.protocol.replace( ':' , '' );
var key = 'Ap8PRYAyAVcyoSPio8EaFtDEpYJVNwEA70GqYj31EXa6jkT_SduFHMKeHnvyS4D_';
var metaUrlTemplate = uriScheme + '://dev.virtualearth.net/REST/v1/Imagery/Metadata/{imagerySet}?include=imageryProviders&uriScheme={uriScheme}&key={key}';
var metaUrl = metaUrlTemplate.replace( '{key}', key ).replace( '{imagerySet}', imagerySet ).replace( '{uriScheme}', uriScheme );
var req = new XMLHttpRequest();
req.open( 'GET', metaUrl );
req.responseType = 'text';
req.addEventListener( 'load', _getTemplate );
req.send();
return;
function _getTemplate () {
metadata = JSON.parse( req.response );
var rss = metadata.resourceSets;
for ( var i = 0; i < rss.length; i++ ) {
var rs = rss[ i ].resources;
for ( var j = 0; j < rs.length; j++ ) {
var r = rs[ j ];
self.subdomains = r.imageUrlSubdomains;
self.urlTemplate = r.imageUrl;
self.minZoom = r.zoomMin;
self.maxZoom = r.zoomMax;
self.subdomainCount = self.subdomains.length;
return;
}
}
}
}
BingProvider.quadkey = function ( x, y, z ) {
var quadKey = [];
for ( var i = z; i > 0; i-- ) {
var digit = '0';
var mask = 1 << ( i - 1 );
if ( ( x & mask ) != 0 ) {
digit++;
}
if ( ( y & mask ) != 0 ) {
digit++;
digit++;
}
quadKey.push( digit );
}
return quadKey.join( '' );
}
BingProvider.prototype.getAttribution = function () {
var img = document.createElement( 'img' );
img.src = 'https://www.microsoft.com/maps/images/branding/bing_maps_logo_white_125px_27px.png';
img.classList.add( 'overlay-branding' );
return img;
};
BingProvider.prototype.getUrl = function ( x, y, z ) {
var urlTemplate = this.urlTemplate;
if ( urlTemplate === null ) return null;
var qk = BingProvider.quadkey( x, y, z );
thissubdomainIndex = ++this.ubdomainIndex % this.subdomainCount;
var url = urlTemplate.replace( '{subdomain}', this.subdomains[ this.subdomainIndex ] ).replace( '{quadkey}', qk );
return url;
};

View File

@ -1,78 +0,0 @@
/**
* @author alteredq / http://alteredqualia.com/
* @author mr.doob / http://mrdoob.com/
*/
var Detector = {
canvas: !! window.CanvasRenderingContext2D,
webgl: ( function () {
try {
var canvas = document.createElement( 'canvas' ); return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) );
} catch ( e ) {
return false;
}
} )(),
workers: !! window.Worker,
fileapi: window.File && window.FileReader && window.FileList && window.Blob,
getWebGLErrorMessage: function () {
var element = document.createElement( 'div' );
element.id = 'webgl-error-message';
element.style.fontFamily = 'monospace';
element.style.fontSize = '13px';
element.style.fontWeight = 'normal';
element.style.textAlign = 'center';
element.style.background = '#fff';
element.style.color = '#000';
element.style.padding = '1.5em';
element.style.width = '400px';
element.style.margin = '5em auto 0';
if ( ! this.webgl ) {
element.innerHTML = window.WebGLRenderingContext ? [
'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br />',
'Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'
].join( '\n' ) : [
'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br/>',
'Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'
].join( '\n' );
}
return element;
},
addGetWebGLMessage: function ( parameters ) {
var parent, id, element;
parameters = parameters || {};
parent = parameters.parent !== undefined ? parameters.parent : document.body;
id = parameters.id !== undefined ? parameters.id : 'oldie';
element = Detector.getWebGLErrorMessage();
element.id = id;
parent.appendChild( element );
}
};
// browserify support
if ( typeof module === 'object' ) {
module.exports = Detector;
}

View File

@ -1,25 +0,0 @@
function NLSProvider () {
}
NLSProvider.prototype.minZoom = 12;
NLSProvider.prototype.maxZoom = 14;
NLSProvider.prototype.getUrl = function ( x, y, z ) {
return NLSTileUrlOS( x, y, z );
}
NLSProvider.prototype.getAttribution = function () {
var a = document.createElement( 'a' );
a.href = 'http://maps.nls.uk';
a.textContent = 'map overlay by National Library of Scotland';
return a;
}

View File

@ -1,22 +0,0 @@
function OSMProvider () {
}
OSMProvider.prototype.getUrl = function ( x, y, z ) {
return 'https://b.tile.openstreetmap.org/' + z + '/' + x + '/' + y + '.png';
}
OSMProvider.prototype.getAttribution = function () {
var a = document.createElement( 'a' );
a.textContent = '© OpenStreetMap contributors';
a.href = 'http://www.openstreetmap.org/copyright';
return a;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
[InternetShortcut]
URL=https://github.com/aardgoose/CaveView.js/releases

View File

@ -1,2 +0,0 @@
[InternetShortcut]
URL=https://aardgoose.github.io/CaveView.js/

View File

@ -419,8 +419,7 @@ div#scene {
</style>
<script type="text/javascript" src="/javascript/CaveView/js/CaveView.js" ></script>
<script type="text/javascript" src="/javascript/CaveView/lib/proj4.js" ></script>
<script type="text/javascript" src="/javascript/CaveView/js/CaveView2.js" ></script>
<script type="text/javascript" >
@ -428,7 +427,7 @@ div#scene {
// display the user interface - and a blank canvas
// the configuration object specifies the location of CaveView, surveys and terrain files
CV.UI.init( 'scene', {
const viewer = new CV2.CaveViewer( 'scene', {
home: '/javascript/CaveView/',
surveyDirectory: '/expowebcache/3d/',
terrainDirectory: '/loser/surface/terrain/' // cannot work, apache not handling this url
@ -436,10 +435,11 @@ div#scene {
// load a single survey to display
// Note the special code in views.caves.py to do this. The appropriate .svx/.3d file may not be simply the cave name +.3d
CV.UI.loadCave('{{svx3d}}.3d');
//const ui = new CV2.CaveViewUI( viewer );
ui.loadCave('{{svx3d}}.3d');
}
// comment out loading CaveView until we have fixed everything
// window.onload = onLoad;
window.onload = onLoad;
</script>
{% endif %} <!-- all the above only loads if cave.survex_file is not empty-->
{% endblock %}