Skip to content

Commit ac22ada

Browse files
committed
Add support for EPT
1 parent 1af7ffc commit ac22ada

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@
173173
<!-- URL Input Form -->
174174
<div id="url-form-container">
175175
<h1>LiDAR Point Cloud Viewer</h1>
176-
<p class="subtitle">Enter a COPC LAZ file URL to visualize</p>
176+
<p class="subtitle">Enter a COPC LAZ or EPT URL to visualize</p>
177177

178178
<form id="url-form">
179179
<input
180180
type="url"
181181
id="url-input"
182-
placeholder="https://example.com/pointcloud.copc.laz"
182+
placeholder="https://example.com/pointcloud.copc.laz or ept.json"
183183
required
184184
>
185185
<button type="submit" id="load-btn">Load</button>
@@ -196,6 +196,9 @@ <h1>LiDAR Point Cloud Viewer</h1>
196196
<button type="button" data-url="https://data.opengeos.org/USGS_LPC_TX_CoastalRegion_2018_A18_stratmap18-50cm-2995201a1.copc.laz">
197197
Texas Coastal Region
198198
</button>
199+
<button type="button" data-url="https://s3-us-west-2.amazonaws.com/usgs-lidar-public/AL_17Co_1_2020/ept.json">
200+
Alabama USGS (EPT)
201+
</button>
199202
</div>
200203

201204
<div class="footer-links">

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"license": "MIT",
1313
"dependencies": {
1414
"maplibre-gl": "^5.14.0",
15-
"maplibre-gl-lidar": "^0.5.0",
15+
"maplibre-gl-lidar": "^0.6.1",
1616
"maplibre-gl-layer-control": "^0.8.1"
1717
},
1818
"devDependencies": {

src/main.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ function initLidarControl(): LidarControl {
8080
* Load a point cloud from the given URL.
8181
*
8282
* Initializes the map and LiDAR control if needed, loads the point cloud
83-
* data, and updates the UI accordingly.
83+
* data, and updates the UI accordingly. Supports both COPC LAZ files and
84+
* EPT (Entwine Point Tiles) datasets.
8485
*
8586
* Args:
86-
* url: The URL of the COPC LAZ file to load.
87+
* url: The URL of the COPC LAZ file or EPT ept.json to load.
8788
*/
8889
async function loadPointCloud(url: string): Promise<void> {
8990
// Show loading indicator
@@ -117,8 +118,9 @@ async function loadPointCloud(url: string): Promise<void> {
117118
'raster-opacity': 1,
118119
},
119120
layout: {
120-
visibility: 'none', // Hidden by default
121+
visibility: 'visible', // Visible by default
121122
},
123+
minzoom: 16,
122124
},
123125
);
124126

@@ -155,8 +157,13 @@ async function loadPointCloud(url: string): Promise<void> {
155157
newUrl.searchParams.set('url', url);
156158
window.history.pushState({}, '', newUrl.toString());
157159

158-
// Update page title
159-
const filename = url.split('/').pop() || 'Point Cloud';
160+
// Update page title (handle EPT URLs specially)
161+
let filename = url.split('/').pop() || 'Point Cloud';
162+
if (filename === 'ept.json') {
163+
// For EPT URLs like .../dublin/ept.json, use the parent folder name
164+
const parts = url.split('/');
165+
filename = parts[parts.length - 2] || 'EPT Dataset';
166+
}
160167
document.title = `${filename} - LiDAR Viewer`;
161168

162169
// Hide form when point cloud is loaded

0 commit comments

Comments
 (0)