locar-tiler 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/locar-tiler.d.ts +92 -0
- package/dist/locar-tiler.mjs +2420 -0
- package/dist/locar-tiler.umd.js +1 -0
- package/package.json +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 AR.js organisation, unless stated otherwise in individual source files
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare class Constants {
|
|
2
|
+
static EARTH: number;
|
|
3
|
+
static HALF_EARTH: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export declare interface DataTile {
|
|
7
|
+
tile: Tile;
|
|
8
|
+
data: any | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare class DEM {
|
|
12
|
+
bottomLeft: EastNorth;
|
|
13
|
+
ptWidth: number;
|
|
14
|
+
ptHeight: number;
|
|
15
|
+
xSpacing: number;
|
|
16
|
+
ySpacing: number;
|
|
17
|
+
elevs: number[];
|
|
18
|
+
constructor(elevs: number[], bottomLeft: EastNorth, ptWidth: number, ptHeight: number, xSpacing: number, ySpacing: number);
|
|
19
|
+
getHeight(x: number, y: number): number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare class DemTiler extends Tiler {
|
|
23
|
+
constructor(url: string);
|
|
24
|
+
readTile(url: string): Promise<RawPngData>;
|
|
25
|
+
getElevation(sphMercPos: EastNorth): number;
|
|
26
|
+
getElevationFromLonLat(lonLat: LonLat): number;
|
|
27
|
+
rawTileToStoredTile(tile: Tile, data: RawPngData): DataTile;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare class EastNorth {
|
|
31
|
+
e: number;
|
|
32
|
+
n: number;
|
|
33
|
+
constructor(e: any, n: any);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare class JsonTiler extends Tiler {
|
|
37
|
+
constructor(url: string);
|
|
38
|
+
readTile(url: string): Promise<any>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare class LonLat {
|
|
42
|
+
lon: number;
|
|
43
|
+
lat: number;
|
|
44
|
+
constructor(lon: any, lat: any);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare interface RawPngData {
|
|
48
|
+
w: number;
|
|
49
|
+
h: number;
|
|
50
|
+
elevs: number[]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export declare class SphMercProjection {
|
|
54
|
+
#private;
|
|
55
|
+
project(lonLat: LonLat): EastNorth;
|
|
56
|
+
unproject(projected: EastNorth): LonLat;
|
|
57
|
+
getTile(p: EastNorth, z: number): Tile;
|
|
58
|
+
getTileFromLonLat(lonLat: LonLat, z: number): Tile;
|
|
59
|
+
getID(): string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export declare class Tile {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
z: number;
|
|
66
|
+
constructor(x: number, y: number, z: number);
|
|
67
|
+
getMetresInTile(): number;
|
|
68
|
+
getBottomLeft(): EastNorth;
|
|
69
|
+
getTopRight(): EastNorth;
|
|
70
|
+
getIndex(): string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export declare abstract class Tiler {
|
|
74
|
+
tile: Tile;
|
|
75
|
+
url: string;
|
|
76
|
+
sphMerc: SphMercProjection;
|
|
77
|
+
dataTiles: Map<string, DataTile>;
|
|
78
|
+
constructor(url: string);
|
|
79
|
+
setZoom(z: number): void;
|
|
80
|
+
lonLatToSphMerc(lonLat: LonLat): EastNorth;
|
|
81
|
+
getTile(sphMercPos: EastNorth, z: number): Tile;
|
|
82
|
+
update(pos: EastNorth): Promise<DataTile[]>;
|
|
83
|
+
updateByLonLat(lonLat: LonLat): Promise<DataTile[]>;
|
|
84
|
+
getCurrentTiles(): DataTile[];
|
|
85
|
+
updateTile(pos: EastNorth): Tile | null;
|
|
86
|
+
loadTile(tile: Tile): Promise<DataTile>;
|
|
87
|
+
abstract readTile(url: string): Promise<any>;
|
|
88
|
+
getData(sphMercPos: EastNorth, z?: number): Promise<Tile>;
|
|
89
|
+
rawTileToStoredTile(tile: Tile, data: any): DataTile;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { }
|