2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

Caveview enabled - local copy 3MB

This commit is contained in:
Philip Sargent 2021-04-02 19:02:10 +01:00
parent b71f2c4ebb
commit 371542fb1e
22 changed files with 95738 additions and 0 deletions

View File

@ -0,0 +1,403 @@
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.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

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

@ -0,0 +1,35 @@
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

@ -0,0 +1,129 @@
/*
* 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

@ -0,0 +1,78 @@
/**
* @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

@ -0,0 +1,25 @@
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

@ -0,0 +1,22 @@
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