@@ -72,10 +72,11 @@ <h4 id="title">PMTiles Shaded Relief</h4>
7272 data-bs-target ="#tag-example-list "
7373 data-title ="pmtiles "
7474 data-content ="<ul class="list-group">
75+ <li><a class="list-group-item list-group-item-action" href="./pmtiles-image.html">PMTiles Image Tiles</a>
7576 <li><a class="list-group-item list-group-item-action active" href="./pmtiles-elevation.html">PMTiles Shaded Relief</a>
7677 </ul> "
7778 tabindex ="0 "
78- > 1 </ a >
79+ > 2 </ a >
7980 </ span >
8081 < span class ="badge-group ">
8182 < a
@@ -160,16 +161,16 @@ <h5 class="modal-title" id="tag-example-title"></h5>
160161
161162 < div class ="row-fluid ">
162163 < h5 class ="source-heading "> main.js</ h5 >
163- < pre > < code id ="example-js-source " class ="language-js "> /* global pmtiles */
164- import DataTile from 'ol/source/DataTile.js';
164+ < pre > < code id ="example-js-source " class ="language-js "> import DataTile from 'ol/source/DataTile.js';
165165import Map from 'ol/Map.js';
166166import TileLayer from 'ol/layer/WebGLTile.js';
167167import View from 'ol/View.js';
168+ import {PMTiles} from 'pmtiles';
168169import {useGeographic} from 'ol/proj.js';
169170
170171useGeographic();
171172
172- const tiles = new pmtiles. PMTiles(
173+ const tiles = new PMTiles(
173174 'https://pub-9288c68512ed46eca46ddcade307709b.r2.dev/protomaps-sample-datasets/terrarium_z9.pmtiles',
174175);
175176
@@ -182,8 +183,8 @@ <h5 class="source-heading">main.js</h5>
182183 });
183184}
184185
185- async function loader(z, x, y) {
186- const response = await tiles.getZxy(z, x, y);
186+ async function loader(z, x, y, {signal} ) {
187+ const response = await tiles.getZxy(z, x, y, signal );
187188 const blob = new Blob([response.data]);
188189 const src = URL.createObjectURL(blob);
189190 const image = await loadImage(src);
@@ -349,7 +350,6 @@ <h5 class="source-heading">index.html</h5>
349350 </tr>
350351 </table>
351352
352- <script src="https://unpkg.com/
[email protected] /dist/index.js"></script>
353353 <script type="module" src="main.js"></script>
354354 </body>
355355</html></ code > </ pre >
@@ -360,7 +360,8 @@ <h5 class="source-heading">package.json</h5>
360360 < pre > < code id ="example-pkg-source " class ="language-json "> {
361361 "name": "pmtiles-elevation",
362362 "dependencies": {
363- "ol": "10.2.2-dev"
363+ "ol": "10.2.2-dev",
364+ "pmtiles": "^3.2.1"
364365 },
365366 "devDependencies": {
366367 "vite": "^3.2.3"
@@ -374,7 +375,6 @@ <h5 class="source-heading">package.json</h5>
374375 </ div >
375376
376377 < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/js/bootstrap.bundle.min.js "
> </ script > 377- < script src ="
https://unpkg.com/[email protected] /dist/index.js "
> </ script > 378378 < script src ="common.js "> </ script >
379379 < script src ="pmtiles-elevation.js "> </ script >
380380 < script src ="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/components/prism-core.min.js "> </ script >
0 commit comments