Skip to content

Commit

Permalink
Merge pull request #9 from NASA-AMMOS/development
Browse files Browse the repository at this point in the history
1.0.2
  • Loading branch information
tariqksoliman authored Aug 19, 2021
2 parents f77ff5a + 7a176b4 commit b79cde2
Show file tree
Hide file tree
Showing 13 changed files with 713 additions and 2,694 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# CHANGELOG

[Official Releases](https://github.com/NASA-AMMOS/LithoSphere/releases)

## v1.0.0

LithoSphere's first release!

## v1.0.1

### Added

- Support for WMS tiles of any projection
- A .tif tile parser

## v1.0.2

### Changed

- PNG.js and zlib.js are now modules instead of globals
2,204 changes: 1 addition & 2,203 deletions dist/lithosphere.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/src/parsers/rgba.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import '../secondary/PNG/zlib';
import '../secondary/PNG/png';
export default function RGBAParser(tilePath: string, layerObj?: any, xyz?: any, tileResolution?: number, numberOfVertices?: number): Promise<number[]>;
16 changes: 16 additions & 0 deletions dist/src/secondary/PNG/png.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default class PNG {
static load(url: any, options: any, callback: any, failureCallback: any): void;
constructor(data1: any);
read(bytes: any): any[];
readUInt32(): number;
readUInt16(): number;
decodePixels(data: any): Uint8Array;
decodePalette(): Uint8Array;
copyToImageData(imageData: any, pixels: any): void;
decode(): Uint8Array;
decodeFrames(ctx: any): void;
renderFrame(ctx: any, number: any): any;
animate(ctx: any): void;
stopAnimation(): void;
render(canvas: any): any;
}
4 changes: 4 additions & 0 deletions dist/src/secondary/PNG/zlib.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export declare const FlateStream: {
(bytes: any): void;
prototype: any;
};
95 changes: 95 additions & 0 deletions examples/exampleProj_2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!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: [
-10669444.87495712004602,
-5335277.22290244046599,
10670555.12504287995398,
5334722.77709755953401,
],
origin: [-10669444.87495712004602, -5335277.22290244046599],
crsCode: '9001',
proj:
'+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
resunitsperpixel: 3396190 / 256,
reszoomlevel: 0,
},
radiusOfTiles: 2,
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/Mars_HRSCMOLA_DEM_200mp_equicyl_RGB/{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>
2 changes: 2 additions & 0 deletions examples/exampleWMSwithDEM.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

console.log(Litho)

/*
Litho.addLayer('tile', {
name: 'NAC Nobile',
order: 1, //Orders are ordered only within the layer type
Expand All @@ -88,6 +89,7 @@
minZoom: 0,
maxZoom: 20,
})
*/

Litho.addControl('myLayers', Litho.controls.layers)
Litho.addControl('myCompass', Litho.controls.compass)
Expand Down
99 changes: 99 additions & 0 deletions examples/exampleWMSwithDEMGlobal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<!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: 0,
zoom: 4,
},
majorRadius: 1737400,
//tileResolution: 3, // Good for debugging
tileMapResource: {
bounds: [-1737400, -1737400, 1737400, 1737400],
origin: [-1737400, 1737400],
crsCode: 'IAU2000:30166,0,0',
proj:
'+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
resunitsperpixel: 8192,
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: 'Global WAC',
order: 1, //Orders are ordered only within the layer type
on: true,
path:
'https://viperserv.jpl.nasa.gov/lunaserv/?layers=luna_wac_global',
demPath:
'https://viperserv.jpl.nasa.gov/lunaserv/?LAYERS=luna_wac_dtm_numeric&FORMAT=image%2Ftiff%3B%20mode=32bit',
format: 'wms', // 'wmts' || 'wms' // wms requires a tileMapResource to be set to help compute tile bboxes
formatOptions: {},
demFormat: 'wms', //
demFormatOptions: {
// for wms, will query tile 1px taller and wider and interpolate values so that tile boundaries line up
correctSeams: true,
// GET Parameters to add to the wms query (they can also just be added straight to the demPath string)
wmsParams: {},
},
parser: 'tif',
opacity: 1,
minZoom: 0,
maxZoom: 18,
})

Litho.addControl('myLayers', Litho.controls.layers)
Litho.addControl('myCompass', Litho.controls.compass)
Litho.addControl('myCoords', Litho.controls.coordinates, {
//existingDivId: 'myCustomCoordDiv',
})
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lithosphere",
"version": "1.0.1",
"version": "1.0.2",
"description": "LithoSphere is a GIS JavaScript library for building 3D tile-based globes in the web browser.",
"author": "Tariq Soliman",
"license": "Apache-2.0",
Expand Down
3 changes: 1 addition & 2 deletions src/parsers/rgba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
* Generated by gdal2customtiles_v3.py (name might change a bit if you're from the future)
*/

import '../secondary/PNG/zlib'
import '../secondary/PNG/png'
import PNG from '../secondary/PNG/png'

//import { NO_DATA_VALUE_INTERNAL } from '../constants'
//import Utils from '../utils'
Expand Down
Loading

0 comments on commit b79cde2

Please sign in to comment.