Skip to content

Commit

Permalink
Upgrade maplibre and pmtiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Feb 23, 2024
1 parent 9f51091 commit b7f6054
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 27 deletions.
62 changes: 40 additions & 22 deletions viewer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@mapbox/mapbox-gl-draw": "^1.4.3",
"chart.js": "^4.4.1",
"chartjs-plugin-dragdata": "^2.2.5",
"pmtiles": "^2.10.0",
"svelte-maplibre": "^0.7.7"
"pmtiles": "^3.0.3",
"svelte-maplibre": "^0.8.1"
}
}
4 changes: 2 additions & 2 deletions viewer/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import init from "lts";
import type { Map as MapType } from "maplibre-gl";
import { FileAPISource, PMTiles } from "pmtiles";
import { FileSource, PMTiles } from "pmtiles";
import { onMount } from "svelte";
import { MapLibre } from "svelte-maplibre";
import { type LayersControls } from "./common";
Expand Down Expand Up @@ -32,7 +32,7 @@
try {
example = "";
let files = fileInput.files!;
pmtiles = new PMTiles(new FileAPISource(files[0]));
pmtiles = new PMTiles(new FileSource(files[0]));
} catch (err) {
window.alert(
`Problem loading this PMTiles file. Don't open the GeoJSON file; make sure to select .pmtiles. Error: ${err}`,
Expand Down
2 changes: 1 addition & 1 deletion viewer/src/Loader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
async function pmtilesInfo(file: PMTiles): Promise<Info> {
let header = await file.getHeader();
let metadata = await file.getMetadata();
let metadata = await file.getMetadata() as any;
return {
bounds: [header.minLon, header.minLat, header.maxLon, header.maxLat],
Expand Down

0 comments on commit b7f6054

Please sign in to comment.