Skip to content

Commit

Permalink
Merge pull request #6 from NASA-AMMOS/development
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
tariqksoliman committed Jul 22, 2021
2 parents f722647 + 795c84a commit f77ff5a
Show file tree
Hide file tree
Showing 46 changed files with 677 additions and 115 deletions.
52 changes: 43 additions & 9 deletions dist/lithosphere.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/src/constants.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const NO_DATA_VALUE_INTERNAL = -1100101;
Empty file added dist/src/controls/altitude.d.ts
Empty file.
15 changes: 15 additions & 0 deletions dist/src/controls/compass.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Corners } from '../generalTypes.d.ts';
interface Private {
}
export default class Compass {
_: Private;
p: any;
name: string;
corner: Corners;
constructor(parent: any, name: string);
getControl: () => string;
attachEvents: () => void;
onUpdate: () => void;
setDirection: () => void;
}
export {};
Empty file added dist/src/controls/controls.d.ts
Empty file.
19 changes: 19 additions & 0 deletions dist/src/controls/coordinates.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Corners } from '../generalTypes.d.ts';
interface Private {
}
interface Params {
existingDivId?: string;
}
export default class Coordinates {
_: Private;
p: any;
name: string;
params: Params;
corner: Corners;
constructor(parent: any, name: string, params?: object);
getControl: () => string;
attachEvents: () => void;
onUpdate: () => void;
private updateMouseCoords;
}
export {};
Empty file added dist/src/controls/crop.d.ts
Empty file.
18 changes: 18 additions & 0 deletions dist/src/controls/exaggerate.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Corners } from '../generalTypes.d.ts';
interface Private {
}
export default class Exaggerate {
_: Private;
id: string;
p: any;
name: string;
corner: Corners;
exaggeration: number;
constructor(parent: any, name: string);
getControl: () => string;
attachEvents: () => void;
private getInactiveContent;
private getActiveContent;
setExaggeration: (multiplier: number) => void;
}
export {};
13 changes: 13 additions & 0 deletions dist/src/controls/home.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Corners } from '../generalTypes';
interface Private {
}
export default class Home {
_: Private;
p: any;
name: string;
corner: Corners;
constructor(parent: any, name: string);
getControl: () => string;
attachEvents: () => void;
}
export {};
17 changes: 17 additions & 0 deletions dist/src/controls/layers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Corners } from '../generalTypes.d.ts';
interface Private {
}
export default class Layers {
_: Private;
id: string;
p: any;
name: string;
corner: Corners;
constructor(parent: any, name: string);
getControl: () => string;
attachEvents: () => void;
private getInactiveContent;
private getActiveContent;
private attachEventsInternal;
}
export {};
16 changes: 16 additions & 0 deletions dist/src/controls/walk.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Corners } from '../generalTypes.d.ts';
interface Private {
}
export default class Walk {
_: Private;
p: any;
name: string;
helpDiv: HTMLElement;
corner: Corners;
constructor(parent: any, name: string);
getControl: () => string;
attachEvents: () => void;
private setCamera;
private leaveWalking;
}
export {};
5 changes: 3 additions & 2 deletions dist/src/core/CRS.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ export default class CRS {
_scales: number[];
R: number;
constructor(code: string, proj: string, options: any, radius: number);
project(latlng: any): any;
unproject(point: any, zoom: any): any;
project(latlng: any, zoom: any, ll2p: any): any;
unproject(point: any, zoom: any, p2ll: any): any;
latLngToPoint(latlng: any, zoom: any): any;
pointToLatLng(point: any, zoom: any): any;
scale(zoom: number): number;
}
14 changes: 1 addition & 13 deletions dist/src/core/projection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,7 @@ export default class Projection {
y: any;
};
};
tileXYZ2NwSe: (xyz: XYZ, tileResolution: number, asBounds?: boolean) => {
min: {
x: any;
y: any;
};
max: {
x: any;
y: any;
};
} | {
nw: any;
se: any;
};
tileXYZ2NwSe: (xyz: XYZ, tileResolution: number, asBounds?: boolean, stretchFactor?: number) => any;
tileXYZ2LatLng: (x: number, y: number, z: number, flatXYZ?: XYZ) => LatLng;
latLngZ2TileXYZ: (lat: number, lng: number, z: number, dontFloor?: boolean) => XYZ;
vector3ToLatLng: (xyz: XYZ) => LatLngH;
Expand Down
Empty file added dist/src/layers/curtain.d.ts
Empty file.
Empty file added dist/src/layers/model.d.ts
Empty file.
Empty file added dist/src/layers/overlay.d.ts
Empty file.
8 changes: 8 additions & 0 deletions dist/src/layers/tile.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default class TileLayerer {
p: any;
constructor(parent: any);
add: (layerObj: any) => void;
toggle: (name: string, on?: boolean) => boolean;
setOpacity: (name: string, opacity: number) => boolean;
remove: (name: string) => boolean;
}
1 change: 1 addition & 0 deletions dist/src/lithosphere.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface Private {
zCutOff: number;
firstViewOverride: any;
mouseIsInScene: boolean;
marsRadius: number;
}
export default class LithoSphere {
_: Private;
Expand Down
Empty file added dist/src/parsers/demt.d.ts
Empty file.
1 change: 1 addition & 0 deletions dist/src/parsers/tif.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function TifParser(tilePath: string, layerObj?: any, xyz?: any, tileResolution?: number, numberOfVertices?: number): Promise<number[]>;
5 changes: 5 additions & 0 deletions dist/src/secondary/OrbitControls.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare function OrbitControls(object: any, domElement: any): void;
declare namespace OrbitControls {
var prototype: any;
}
export default OrbitControls;
Empty file.
1 change: 1 addition & 0 deletions dist/src/secondary/PointerLockControls.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function PointerLockControls(camera: any): void;
7 changes: 7 additions & 0 deletions dist/src/secondary/loadingScreen.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import './loadingScreen.scss';
export default class Controls {
p: any;
loadingContainer: HTMLElement;
constructor(parent: any);
end: (name: any) => void;
}
5 changes: 2 additions & 3 deletions dist/src/utils/paths.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
declare const Paths: {
buildPath: (format: string, basePath: string, tD: any, projection: any, tileResolution: number, options?: any, asObject?: boolean) => any;
buildPath: (format: string, basePath: string, tD: any, projection: any, tileResolution: number, trueTileResolution: number, options?: any, asObject?: boolean) => any;
wmsExtension: {
defaultWmsParams: {
SERVICE: string;
REQUEST: string;
FORMAT: string;
TRANSPARENT: boolean;
VERSION: string;
wmsVersion: any;
WIDTH: any;
HEIGHT: any;
};
extensionOptions: {
crsCode: string;
uppercase: boolean;
};
buildPath: (basePath: string, xyz: any, projection: any, tileResolution: number, options: any) => string;
buildPath: (basePath: string, xyz: any, projection: any, tileResolution: number, trueTileResolution: number, options: any) => string;
};
};
export default Paths;
2 changes: 1 addition & 1 deletion docs/pages/Getting-Started/getting_started.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If you're not using npm just yet, that's okay, we support you too.
```html
<script src="your/path/to/lithosphere.js"></script>
```
3. Using the `example.html` file as a guide, use something like the following to initialize LithoSphere:
3. Using the `examples/example.html` file as a guide, use something like the following to initialize LithoSphere:
```html
<div id="container"></div>
<script>
Expand Down
6 changes: 6 additions & 0 deletions docs/pages/Layers/Tile/tile.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Litho.addLayer('tile', {
// TODO: Implement format
format: 'tms', // 'wmts' || 'wms'
demFormat: 'tms', //
demFormatOptions: {
// For wms dem formats it'll query tiles with a 1px buffer and interpolate values so that tile boundaries line up perfectly
correctSeams: true,
// GET Parameters to add to the wms query (they can also just be added straight to the demPath string)
wmsParams: {},
},
opacity: 1,
minZoom: 10,
maxZoom: 17,
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/Layers/layers.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nav_order: 4

# Layers

_Apologizes the Layers type pages aren't as filled out as they could be. The examples in example.html should get you pretty far nonetheless._
_Apologizes the Layers type pages aren't as filled out as they could be. The examples in `/examples` should get you pretty far nonetheless._

Layers are how you add data into Lithosphere. There are many different types of layers each with different options to set.

Expand Down
3 changes: 2 additions & 1 deletion example.html → examples/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LithoSphere Demo</title>

<script src="./dist/lithosphere.js"></script>
<script src="../dist/lithosphere.js"></script>
<style>
html,
body {
Expand Down Expand Up @@ -40,6 +40,7 @@
lat: -4.626971631163808,
zoom: 16,
},
majorRadius: 3396190,
loadingScreen: true, // default true
customParsers: {
All500: (tilePath, layerObj) => {
Expand Down
90 changes: 90 additions & 0 deletions examples/exampleProj.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LithoSphere Demo</title>

<script src="../dist/lithosphere.js"></script>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
background: black;
}
#container {
width: 100%;
height: 100%;
overflow: hidden;
}
#myCustomCoordDiv {
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
background: white;
color: black;
padding: 2px 4px;
}
</style>
</head>
<body>
<div id="container"></div>
<!--<div id="myCustomCoordDiv"></div>-->
<script>
const Litho = new LithoSphere.default('container', {
initialView: {
lng: 0, // default 0
lat: -89.9,
zoom: 0,
},
majorRadius: 1737400,
tileMapResource: {
// minx, miny, maxx, maxy
bounds: [-1095700 - 1095600, 1095600, 1095700],
origin: [-1095700, -1095600],
crsCode: 'IAU2000:30166,0,-89.9',
proj:
'+proj=stere +lat_0=-89.9 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs', // proj4 string describing the global tileset projection: string (opt) | default wgs84
resunitsperpixel: 128000,
reszoomlevel: 0,
},
//radiusOfTiles: 3,
useLOD: false,
//wireframeMode: true,
starsphere: {
url:
'https://miplmmgis.jpl.nasa.gov/public/images/eso0932a.jpg',
color: '#444444',
},
atmosphere: {
color: '#222227',
},
})

console.log(Litho)

Litho.addLayer('tile', {
name: 'Mars',
order: 1, //Orders are ordered only within the layer type
on: true,
path:
'http://localhost:8889/Missions/Projections/Layers/Basemap/MarsDEM/LRO_WAC_Mosaic_SPole60_100m_v2/{z}/{x}/{y}.png',
demPath: null,
format: 'tms', // 'wmts' || 'wms' // wms requires a tileMapResource to be set to help compute tile bboxes
formatOptions: {},
demFormat: 'tms', //
demFormatOptions: {},
opacity: 1,
minZoom: 0,
maxZoom: 10,
})

Litho.addControl('myLayers', Litho.controls.layers)
Litho.addControl('myCompass', Litho.controls.compass)
Litho.addControl('myCoords', Litho.controls.coordinates)
</script>
</body>
</html>
15 changes: 1 addition & 14 deletions example2.html → examples/exampleWMS.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LithoSphere Demo</title>

<script src="./dist/lithosphere.js"></script>
<script src="../dist/lithosphere.js"></script>
<style>
html,
body {
Expand Down Expand Up @@ -41,19 +41,6 @@
zoom: 0,
},
majorRadius: 1737400,
customParsers: {
All500: (tilePath, layerObj) => {
return new Promise((resolve, reject) => {
const tileDimension = 32
resolve(
new Array(tileDimension * tileDimension).fill(
500
)
)
})
},
},
//opt
tileMapResource: {
//bounds: [-868700, -868700, 868700, 868700],
//origin: [-868700, -868700],
Expand Down
Loading

0 comments on commit f77ff5a

Please sign in to comment.