Skip to content

Commit b79cde2

Browse files
Merge pull request #9 from NASA-AMMOS/development
1.0.2
2 parents f77ff5a + 7a176b4 commit b79cde2

File tree

13 files changed

+713
-2694
lines changed

13 files changed

+713
-2694
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# CHANGELOG
2+
3+
[Official Releases](https://github.com/NASA-AMMOS/LithoSphere/releases)
4+
5+
## v1.0.0
6+
7+
LithoSphere's first release!
8+
9+
## v1.0.1
10+
11+
### Added
12+
13+
- Support for WMS tiles of any projection
14+
- A .tif tile parser
15+
16+
## v1.0.2
17+
18+
### Changed
19+
20+
- PNG.js and zlib.js are now modules instead of globals

dist/lithosphere.js

Lines changed: 1 addition & 2203 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/parsers/rgba.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import '../secondary/PNG/zlib';
2-
import '../secondary/PNG/png';
31
export default function RGBAParser(tilePath: string, layerObj?: any, xyz?: any, tileResolution?: number, numberOfVertices?: number): Promise<number[]>;

dist/src/secondary/PNG/png.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default class PNG {
2+
static load(url: any, options: any, callback: any, failureCallback: any): void;
3+
constructor(data1: any);
4+
read(bytes: any): any[];
5+
readUInt32(): number;
6+
readUInt16(): number;
7+
decodePixels(data: any): Uint8Array;
8+
decodePalette(): Uint8Array;
9+
copyToImageData(imageData: any, pixels: any): void;
10+
decode(): Uint8Array;
11+
decodeFrames(ctx: any): void;
12+
renderFrame(ctx: any, number: any): any;
13+
animate(ctx: any): void;
14+
stopAnimation(): void;
15+
render(canvas: any): any;
16+
}

dist/src/secondary/PNG/zlib.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export declare const FlateStream: {
2+
(bytes: any): void;
3+
prototype: any;
4+
};

examples/exampleProj_2.html

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>LithoSphere Demo</title>
7+
8+
<script src="../dist/lithosphere.js"></script>
9+
<style>
10+
html,
11+
body {
12+
width: 100%;
13+
height: 100%;
14+
margin: 0;
15+
background: black;
16+
}
17+
#container {
18+
width: 100%;
19+
height: 100%;
20+
overflow: hidden;
21+
}
22+
#myCustomCoordDiv {
23+
position: absolute;
24+
top: 10px;
25+
left: 50%;
26+
transform: translateX(-50%);
27+
background: white;
28+
color: black;
29+
padding: 2px 4px;
30+
}
31+
</style>
32+
</head>
33+
<body>
34+
<div id="container"></div>
35+
<!--<div id="myCustomCoordDiv"></div>-->
36+
<script>
37+
const Litho = new LithoSphere.default('container', {
38+
initialView: {
39+
lng: 0, // default 0
40+
lat: -89.9,
41+
zoom: 0,
42+
},
43+
majorRadius: 1737400,
44+
tileMapResource: {
45+
// minx, miny, maxx, maxy
46+
bounds: [
47+
-10669444.87495712004602,
48+
-5335277.22290244046599,
49+
10670555.12504287995398,
50+
5334722.77709755953401,
51+
],
52+
origin: [-10669444.87495712004602, -5335277.22290244046599],
53+
crsCode: '9001',
54+
proj:
55+
'+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=3396190 +b=3396190 +units=m +no_defs', // proj4 string describing the global tileset projection: string (opt) | default wgs84
56+
resunitsperpixel: 3396190 / 256,
57+
reszoomlevel: 0,
58+
},
59+
radiusOfTiles: 2,
60+
useLOD: false,
61+
//wireframeMode: true,
62+
starsphere: {
63+
url:
64+
'https://miplmmgis.jpl.nasa.gov/public/images/eso0932a.jpg',
65+
color: '#444444',
66+
},
67+
atmosphere: {
68+
color: '#222227',
69+
},
70+
})
71+
72+
console.log(Litho)
73+
74+
Litho.addLayer('tile', {
75+
name: 'Mars',
76+
order: 1, //Orders are ordered only within the layer type
77+
on: true,
78+
path:
79+
'http://localhost:8889/Missions/Projections/Layers/Basemap/MarsDEM/Mars_HRSCMOLA_DEM_200mp_equicyl_RGB/{z}/{x}/{y}.png',
80+
demPath: null,
81+
format: 'tms', // 'wmts' || 'wms' // wms requires a tileMapResource to be set to help compute tile bboxes
82+
formatOptions: {},
83+
demFormat: 'tms', //
84+
demFormatOptions: {},
85+
opacity: 1,
86+
minZoom: 0,
87+
maxZoom: 10,
88+
})
89+
90+
Litho.addControl('myLayers', Litho.controls.layers)
91+
Litho.addControl('myCompass', Litho.controls.compass)
92+
Litho.addControl('myCoords', Litho.controls.coordinates)
93+
</script>
94+
</body>
95+
</html>

examples/exampleWMSwithDEM.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666

6767
console.log(Litho)
6868

69+
/*
6970
Litho.addLayer('tile', {
7071
name: 'NAC Nobile',
7172
order: 1, //Orders are ordered only within the layer type
@@ -88,6 +89,7 @@
8889
minZoom: 0,
8990
maxZoom: 20,
9091
})
92+
*/
9193

9294
Litho.addControl('myLayers', Litho.controls.layers)
9395
Litho.addControl('myCompass', Litho.controls.compass)

examples/exampleWMSwithDEMGlobal.html

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>LithoSphere Demo</title>
7+
8+
<script src="../dist/lithosphere.js"></script>
9+
<style>
10+
html,
11+
body {
12+
width: 100%;
13+
height: 100%;
14+
margin: 0;
15+
background: black;
16+
}
17+
#container {
18+
width: 100%;
19+
height: 100%;
20+
overflow: hidden;
21+
}
22+
#myCustomCoordDiv {
23+
position: absolute;
24+
top: 10px;
25+
left: 50%;
26+
transform: translateX(-50%);
27+
background: white;
28+
color: black;
29+
padding: 2px 4px;
30+
}
31+
</style>
32+
</head>
33+
<body>
34+
<div id="container"></div>
35+
<!--<div id="myCustomCoordDiv"></div>-->
36+
<script>
37+
const Litho = new LithoSphere.default('container', {
38+
initialView: {
39+
lng: 0, // default 0
40+
lat: 0,
41+
zoom: 4,
42+
},
43+
majorRadius: 1737400,
44+
//tileResolution: 3, // Good for debugging
45+
tileMapResource: {
46+
bounds: [-1737400, -1737400, 1737400, 1737400],
47+
origin: [-1737400, 1737400],
48+
crsCode: 'IAU2000:30166,0,0',
49+
proj:
50+
'+proj=stere +lat_0=0 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=1737400 +b=1737400 +units=m +no_defs', // proj4 string describing the global tileset projection: string (opt) | default wgs84
51+
resunitsperpixel: 8192,
52+
reszoomlevel: 0,
53+
},
54+
//radiusOfTiles: 3,
55+
useLOD: false,
56+
//wireframeMode: true,
57+
starsphere: {
58+
url:
59+
'https://miplmmgis.jpl.nasa.gov/public/images/eso0932a.jpg',
60+
color: '#444444',
61+
},
62+
atmosphere: {
63+
color: '#222227',
64+
},
65+
})
66+
67+
console.log(Litho)
68+
69+
Litho.addLayer('tile', {
70+
name: 'Global WAC',
71+
order: 1, //Orders are ordered only within the layer type
72+
on: true,
73+
path:
74+
'https://viperserv.jpl.nasa.gov/lunaserv/?layers=luna_wac_global',
75+
demPath:
76+
'https://viperserv.jpl.nasa.gov/lunaserv/?LAYERS=luna_wac_dtm_numeric&FORMAT=image%2Ftiff%3B%20mode=32bit',
77+
format: 'wms', // 'wmts' || 'wms' // wms requires a tileMapResource to be set to help compute tile bboxes
78+
formatOptions: {},
79+
demFormat: 'wms', //
80+
demFormatOptions: {
81+
// for wms, will query tile 1px taller and wider and interpolate values so that tile boundaries line up
82+
correctSeams: true,
83+
// GET Parameters to add to the wms query (they can also just be added straight to the demPath string)
84+
wmsParams: {},
85+
},
86+
parser: 'tif',
87+
opacity: 1,
88+
minZoom: 0,
89+
maxZoom: 18,
90+
})
91+
92+
Litho.addControl('myLayers', Litho.controls.layers)
93+
Litho.addControl('myCompass', Litho.controls.compass)
94+
Litho.addControl('myCoords', Litho.controls.coordinates, {
95+
//existingDivId: 'myCustomCoordDiv',
96+
})
97+
</script>
98+
</body>
99+
</html>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lithosphere",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "LithoSphere is a GIS JavaScript library for building 3D tile-based globes in the web browser.",
55
"author": "Tariq Soliman",
66
"license": "Apache-2.0",

src/parsers/rgba.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* Generated by gdal2customtiles_v3.py (name might change a bit if you're from the future)
66
*/
77

8-
import '../secondary/PNG/zlib'
9-
import '../secondary/PNG/png'
8+
import PNG from '../secondary/PNG/png'
109

1110
//import { NO_DATA_VALUE_INTERNAL } from '../constants'
1211
//import Utils from '../utils'

0 commit comments

Comments
 (0)