Skip to content

Commit 447ad4d

Browse files
authored
Prototype/geotiff (#19)
* Clean * Add example of loading geotiffs
1 parent 4d93ba2 commit 447ad4d

File tree

5 files changed

+891
-1
lines changed

5 files changed

+891
-1
lines changed

prototype/geotiff/index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>GeoTIFF with Overviews</title>
7+
<link rel="stylesheet" href="node_modules/ol/ol.css">
8+
<style>
9+
.map {
10+
width: 100%;
11+
height: 400px;
12+
}
13+
</style>
14+
</head>
15+
16+
<body>
17+
<div id="map" class="map"></div>
18+
19+
<script type="module" src="main.js"></script>
20+
</body>
21+
22+
</html>

prototype/geotiff/main.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import GeoTIFF from "ol/source/GeoTIFF.js";
2+
import Map from "ol/Map.js";
3+
import TileLayer from "ol/layer/WebGLTile.js";
4+
5+
const source = new GeoTIFF({
6+
sources: [
7+
{
8+
// url: "https://openlayers.org/data/raster/no-overviews.tif",
9+
// url: "https://ngimapservicestorage.blob.core.windows.net/geotiff/TNW/TWN-R01_cog.tif",
10+
url: "https://ngimapservicestorage.blob.core.windows.net/geotiff/TNW/TWN-R01.tif",
11+
// overviews: ["https://openlayers.org/data/raster/no-overviews.tif.ovr"],
12+
},
13+
],
14+
});
15+
16+
const map = new Map({
17+
target: "map",
18+
layers: [
19+
new TileLayer({
20+
source: source,
21+
}),
22+
],
23+
view: source.getView(),
24+
});

0 commit comments

Comments
 (0)