Skip to content

Commit a9e033d

Browse files
committed
Website updates
1 parent 56ebe9b commit a9e033d

27 files changed

Lines changed: 351 additions & 25 deletions

dist/en/main/apidoc/module-ol_source_GeoTIFF-GeoTIFFSource.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ <h4 class="name">
166166

167167
<div class="tag-source">
168168
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/source/GeoTIFF.js">source/GeoTIFF.js</a>,
169-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/source/GeoTIFF.js#L387">line 387</a>
169+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/source/GeoTIFF.js#L417">line 417</a>
170170
</div>
171171

172172
</div>
@@ -1806,7 +1806,7 @@ <h4 class="name">
18061806

18071807
<div class="tag-source">
18081808
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/source/GeoTIFF.js">source/GeoTIFF.js</a>,
1809-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/source/GeoTIFF.js#L1048">line 1048</a>
1809+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/source/GeoTIFF.js#L1078">line 1078</a>
18101810
</div>
18111811

18121812
</div>

dist/en/main/apidoc/module-ol_source_GeoTIFF.html

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,30 @@ <h5 class="subsection-title">Properties:</h5>
13021302

13031303

13041304

1305+
<tr>
1306+
1307+
<td class="name"><code>loader</code></td>
1308+
1309+
1310+
<td class="type">
1311+
1312+
1313+
<span class="param-type">function</span>
1314+
1315+
| undefined
1316+
1317+
1318+
</td>
1319+
1320+
<td class="description last">
1321+
<p>Custom loader function for URL based sources.
1322+
Called with the URL, request headers, and an abort signal. Expected to resolve with a <code>Response</code>.</p>
1323+
1324+
</td>
1325+
</tr>
1326+
1327+
1328+
13051329
<tr>
13061330

13071331
<td class="name"><code>overviews</code></td>
@@ -1318,7 +1342,7 @@ <h5 class="subsection-title">Properties:</h5>
13181342
</td>
13191343

13201344
<td class="description last">
1321-
<p>List of any overview URLs, only applies if the url parameter is given.</p>
1345+
<p>List of any overview URLs, only applies if the url parameter is given and no loader is specified.</p>
13221346

13231347
</td>
13241348
</tr>

dist/en/main/examples/cog-blob.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ <h4 id="title">Cloud Optimized GeoTIFF (COG) from a Blob</h4>
7575
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-style.html&quot;&gt;Change Tile Layer Style&lt;/a&gt;
7676
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog.html&quot;&gt;Cloud Optimized GeoTIFF (COG)&lt;/a&gt;
7777
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action active&quot; href=&quot;./cog-blob.html&quot;&gt;Cloud Optimized GeoTIFF (COG) from a Blob&lt;/a&gt;
78+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-custom-client.html&quot;&gt;Cloud Optimized GeoTIFF (COG) with Custom Loader&lt;/a&gt;
7879
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-modeltransformation.html&quot;&gt;COG with ModelTransformation&lt;/a&gt;
7980
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-projection.html&quot;&gt;COG with Projection Lookup&lt;/a&gt;
8081
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./geotiff-reprojection.html&quot;&gt;GeoTIFF Reprojection&lt;/a&gt;
@@ -87,7 +88,7 @@ <h4 id="title">Cloud Optimized GeoTIFF (COG) from a Blob</h4>
8788
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./stac-item.html&quot;&gt;STAC support&lt;/a&gt;
8889
&lt;/ul&gt;"
8990
tabindex="0"
90-
>14</a>
91+
>15</a>
9192
</span>
9293
</p>
9394
<div class="modal modal-tag-example" id="tag-example-list" tabindex="-1" role="dialog" aria-labelledby="tag-example-title" aria-hidden="true">

dist/en/main/examples/cog-colors.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ <h4 id="title">NDVI with a Dynamic Color Ramp</h4>
7676
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-style.html&quot;&gt;Change Tile Layer Style&lt;/a&gt;
7777
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog.html&quot;&gt;Cloud Optimized GeoTIFF (COG)&lt;/a&gt;
7878
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-blob.html&quot;&gt;Cloud Optimized GeoTIFF (COG) from a Blob&lt;/a&gt;
79+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-custom-client.html&quot;&gt;Cloud Optimized GeoTIFF (COG) with Custom Loader&lt;/a&gt;
7980
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-modeltransformation.html&quot;&gt;COG with ModelTransformation&lt;/a&gt;
8081
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-projection.html&quot;&gt;COG with Projection Lookup&lt;/a&gt;
8182
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./geotiff-reprojection.html&quot;&gt;GeoTIFF Reprojection&lt;/a&gt;
@@ -88,7 +89,7 @@ <h4 id="title">NDVI with a Dynamic Color Ramp</h4>
8889
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./stac-item.html&quot;&gt;STAC support&lt;/a&gt;
8990
&lt;/ul&gt;"
9091
tabindex="0"
91-
>14</a>
92+
>15</a>
9293
</span>
9394
<span class="badge-group">
9495
<a
Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
6+
<title>Cloud Optimized GeoTIFF (COG) with Custom Loader</title>
7+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" crossorigin="anonymous">
8+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/fontawesome.min.css" crossorigin="anonymous">
9+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/solid.css" crossorigin="anonymous">
10+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/brands.css" crossorigin="anonymous">
11+
<link rel="stylesheet" type="text/css" href="./theme/ol.css">
12+
<link rel="stylesheet" type="text/css" href="/theme/site.css">
13+
<link rel="icon" type="image/svg+xml" href="/theme/img/logo-light.svg" media="(prefers-color-scheme: light)" />
14+
<link rel="icon" type="image/svg+xml" href="/theme/img/logo-dark.svg" media="(prefers-color-scheme: dark)" />
15+
</head>
16+
<body>
17+
<header class="navbar navbar-expand-md navbar-dark mb-3 px-3 py-0 fixed-top" role="navigation">
18+
<a class="navbar-brand" href="/"><img src="/theme/img/logo-dark.svg" width="70" height="70" alt="">&nbsp;OpenLayers</a>
19+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#olmenu" aria-controls="olmenu" aria-expanded="false" aria-label="Toggle navigation">
20+
<span class="navbar-toggler-icon"></span>
21+
</button>
22+
23+
<!-- menu items that get hidden below 768px width -->
24+
<nav class="collapse navbar-collapse" id="olmenu">
25+
<ul class="nav navbar-nav ms-auto">
26+
<li class="nav-item dropdown">
27+
<a class="nav-link dropdown-toggle" href="#" id="docdropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Docs</a>
28+
<div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="docdropdown">
29+
<a class="dropdown-item" href="/doc/">Docs</a>
30+
<div class="dropdown-divider"></div>
31+
<a class="dropdown-item" href="/doc/quickstart.html"><i class="fa fa-check fa-fw me-2 fa-lg"></i>Quick Start</a>
32+
<a class="dropdown-item" href="/doc/faq.html"><i class="fa fa-question fa-fw me-2 fa-lg"></i>FAQ</a>
33+
<a class="dropdown-item" href="/doc/tutorials/"><i class="fa fa-book fa-fw me-2 fa-lg"></i>Tutorials</a>
34+
<a class="dropdown-item" href="/workshop/"><i class="fa fa-graduation-cap fa-fw me-2 fa-lg"></i>Workshop</a>
35+
<div class="dropdown-divider"></div>
36+
<a class="dropdown-item" href="https://stackoverflow.com/questions/tagged/openlayers"><i class="fab fa-stack-overflow fa-fw me-2"></i>Ask a Question</a>
37+
</div>
38+
</li>
39+
<li class="nav-item"><a class="nav-link" href="../examples/">Examples</a></li>
40+
<li class="nav-item"><a class="nav-link" href="../apidoc/"><i class="fa fa-sitemap me-1"></i>API</a></li>
41+
<li class="nav-item dropdown">
42+
<a class="nav-link dropdown-toggle" href="#" id="codedropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Code</a>
43+
<div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="codedropdown">
44+
<a class="dropdown-item" href="https://github.com/openlayers/openlayers"><i class="fab fa-github fa-fw me-2 fa-lg"></i>Repository</a>
45+
<a class="dropdown-item" href="/download/"><i class="fa fa-download fa-fw me-2 fa-lg"></i>Download</a>
46+
</div>
47+
</li>
48+
</ul>
49+
</nav>
50+
</header>
51+
52+
<div class="container-fluid line-numbers">
53+
<div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
54+
<button id="latest-dismiss" type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
55+
This example uses OpenLayers v<span>10.8.1-dev</span>. The <a id="latest-link" href="#" class="alert-link">latest</a> is v<span id="latest-version"></span>.
56+
</div>
57+
58+
59+
<div class="row-fluid">
60+
<a href="#" id="codepen-button" class="btn btn-link float-end">
61+
<i class="fab fa-codepen fa-lg"></i> Edit
62+
</a>
63+
<h4 id="title">Cloud Optimized GeoTIFF (COG) with Custom Loader</h4>
64+
<p class="tags">
65+
<span class="badge-group">
66+
<a
67+
href="./index.html?q=cog" class="badge badge-info">cog</a
68+
><a
69+
class="badge badge-info tag-modal-toggle"
70+
data-bs-toggle="modal"
71+
data-bs-target="#tag-example-list"
72+
data-title="cog"
73+
data-content="&lt;ul class=&quot;list-group&quot;&gt;
74+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-stretch.html&quot;&gt;Band Contrast Stretch&lt;/a&gt;
75+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-style.html&quot;&gt;Change Tile Layer Style&lt;/a&gt;
76+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog.html&quot;&gt;Cloud Optimized GeoTIFF (COG)&lt;/a&gt;
77+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-blob.html&quot;&gt;Cloud Optimized GeoTIFF (COG) from a Blob&lt;/a&gt;
78+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action active&quot; href=&quot;./cog-custom-client.html&quot;&gt;Cloud Optimized GeoTIFF (COG) with Custom Loader&lt;/a&gt;
79+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-modeltransformation.html&quot;&gt;COG with ModelTransformation&lt;/a&gt;
80+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-projection.html&quot;&gt;COG with Projection Lookup&lt;/a&gt;
81+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./geotiff-reprojection.html&quot;&gt;GeoTIFF Reprojection&lt;/a&gt;
82+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-pyramid.html&quot;&gt;GeoTIFF tile pyramid&lt;/a&gt;
83+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-overviews.html&quot;&gt;GeoTIFF with Overviews&lt;/a&gt;
84+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./multiple-cogs.html&quot;&gt;Multiple COG sources&lt;/a&gt;
85+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-math.html&quot;&gt;NDVI from a Sentinel 2 COG&lt;/a&gt;
86+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-colors.html&quot;&gt;NDVI with a Dynamic Color Ramp&lt;/a&gt;
87+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-math-multisource.html&quot;&gt;NDVI+NDWI from two 16-bit COGs&lt;/a&gt;
88+
&lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./stac-item.html&quot;&gt;STAC support&lt;/a&gt;
89+
&lt;/ul&gt;"
90+
tabindex="0"
91+
>15</a>
92+
</span>
93+
</p>
94+
<div class="modal modal-tag-example" id="tag-example-list" tabindex="-1" role="dialog" aria-labelledby="tag-example-title" aria-hidden="true">
95+
<div class="modal-dialog modal-dialog-scrollable" role="document">
96+
<div class="modal-content">
97+
<div class="modal-header">
98+
<h5 class="modal-title" id="tag-example-title"></h5>
99+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
100+
</div>
101+
<div class="modal-body">
102+
<div class="list-group"></div>
103+
</div>
104+
</div>
105+
</div>
106+
</div>
107+
<div id="map" class="map"></div>
108+
109+
<form method="POST" id="codepen-form" target="_blank" action="https://codesandbox.io/api/v1/sandboxes/define">
110+
<input id="codesandbox-params" type="hidden" name="parameters">
111+
</form>
112+
</div>
113+
114+
<div class="row-fluid">
115+
<p id="shortdesc">Rendering a COG with a custom loader function.</p>
116+
<div id="docs"><p>Tiled data from a Cloud Optimized GeoTIFF (COG) can be rendered as a layer. In this example, a custom loader function is provided to handle requests with custom headers or authentication logic. The loader receives the URL, headers, and an abort signal, and must return a Response object.</p>
117+
</div>
118+
</div>
119+
120+
<div class="row-fluid">
121+
<h5 class="source-heading">main.js</h5>
122+
<pre><code id="example-js-source" class="language-js">import Map from &#x27;ol/Map.js&#x27;;
123+
import {getView, withExtentCenter, withHigherResolutions} from &#x27;ol/View.js&#x27;;
124+
import TileLayer from &#x27;ol/layer/WebGLTile.js&#x27;;
125+
import GeoTIFF from &#x27;ol/source/GeoTIFF.js&#x27;;
126+
127+
const dataUrl &#x3D;
128+
&#x27;https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/36/Q/WD/2020/7/S2A_36QWD_20200701_0_L2A/TCI.tif&#x27;;
129+
130+
const source &#x3D; new GeoTIFF({
131+
sources: [
132+
{
133+
url: dataUrl,
134+
// Use a custom loader function to control how the data is fetched.
135+
// The function receives the URL, request headers, and an abort signal.
136+
loader: (url, headers, abortSignal) &#x3D;&gt; {
137+
// Add custom headers (e.g., authentication tokens)
138+
const customHeaders &#x3D; {
139+
...headers,
140+
// Example: &#x27;Authorization&#x27;: &#x27;Bearer your-token-here&#x27;,
141+
};
142+
143+
// Optionally add custom logic (logging, retry logic, caching, etc.)
144+
145+
return fetch(url, {
146+
headers: customHeaders,
147+
signal: abortSignal,
148+
});
149+
},
150+
},
151+
],
152+
});
153+
154+
const map &#x3D; new Map({
155+
target: &#x27;map&#x27;,
156+
layers: [
157+
new TileLayer({
158+
source: source,
159+
}),
160+
],
161+
view: getView(source, withHigherResolutions(1), withExtentCenter()),
162+
});
163+
</code></pre>
164+
</div>
165+
166+
<div class="row-fluid">
167+
<h5 class="source-heading">index.html</h5>
168+
<pre><code id="example-html-source" class="language-markup">&lt;!DOCTYPE html&gt;
169+
&lt;html lang="en"&gt;
170+
&lt;head&gt;
171+
&lt;meta charset="UTF-8"&gt;
172+
&lt;title&gt;Cloud Optimized GeoTIFF (COG) with Custom Loader&lt;/title&gt;
173+
&lt;link rel="stylesheet" href="node_modules/ol/ol.css"&gt;
174+
&lt;style&gt;
175+
.map {
176+
width: 100%;
177+
height: 400px;
178+
}
179+
&lt;/style&gt;
180+
&lt;/head&gt;
181+
&lt;body&gt;
182+
&lt;div id&#x3D;&quot;map&quot; class&#x3D;&quot;map&quot;&gt;&lt;/div&gt;
183+
184+
&lt;script type="module" src="main.js"&gt;&lt;/script&gt;
185+
&lt;/body&gt;
186+
&lt;/html&gt;</code></pre>
187+
</div>
188+
189+
<div class="row-fluid">
190+
<h5 class="source-heading">package.json</h5>
191+
<pre><code id="example-pkg-source" class="language-json">{
192+
&quot;name&quot;: &quot;cog-custom-client&quot;,
193+
&quot;dependencies&quot;: {
194+
&quot;ol&quot;: &quot;10.8.1-dev&quot;
195+
},
196+
&quot;devDependencies&quot;: {
197+
&quot;vite&quot;: &quot;^3.2.3&quot;
198+
},
199+
&quot;scripts&quot;: {
200+
&quot;start&quot;: &quot;vite&quot;,
201+
&quot;build&quot;: &quot;vite build&quot;
202+
}
203+
}</code></pre>
204+
</div>
205+
</div>
206+
207+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"></script>
208+
<script src="common.js"></script>
209+
<script src="cog-custom-client.js"></script>
210+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/components/prism-core.min.js"></script>
211+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/autoloader/prism-autoloader.min.js"></script>
212+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/toolbar/prism-toolbar.min.js"></script>
213+
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.js"></script>
214+
<script src="./resources/common.js"></script>
215+
<script>
216+
document.getElementById('tag-example-list')
217+
.addEventListener('show.bs.modal', function (event) {
218+
const button = event.relatedTarget; // Button that triggered the modal
219+
this.querySelector('.modal-title').innerText = button.dataset.title;
220+
this.querySelector('.modal-body').innerHTML = button.dataset.content;
221+
});
222+
</script>
223+
<script>
224+
const releaseUrl = 'https://cdn.jsdelivr.net/npm/ol/package.json';
225+
fetch(releaseUrl).then(function(response) {
226+
return response.json();
227+
}).then(function(json) {
228+
const latestVersion = json.version;
229+
document.getElementById('latest-version').innerHTML = latestVersion;
230+
const url = window.location.href;
231+
const branchSearch = url.match(/\/([^\/]*)\/examples\//);
232+
const storageKey = 'ol-dismissed=-' + latestVersion;
233+
const dismissed = localStorage.getItem(storageKey) === 'true';
234+
if (branchSearch && !dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && '10.8.1-dev' != latestVersion) {
235+
const link = url.replace(branchSearch[0], '/latest/examples/');
236+
fetch(link, {method: 'head'}).then(function(response) {
237+
const a = document.getElementById('latest-link');
238+
a.href = response.status == 200 ? link : '../../latest/examples/';
239+
});
240+
const latestCheck = document.getElementById('latest-check');
241+
latestCheck.style.display = '';
242+
document.getElementById('latest-dismiss').onclick = function() {
243+
latestCheck.style.display = 'none';
244+
localStorage.setItem(storageKey, 'true');
245+
}
246+
}
247+
});
248+
</script>
249+
</body>
250+
</html>

0 commit comments

Comments
 (0)