protomaps / PMTiles

Cloud-optimized + compressed single-file tile archives for vector and raster maps

Home Page:https://protomaps.com/docs/pmtiles/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression in `2.11.0`?

raphaellaude opened this issue · comments

I noticed today my map was no longer rendering. Seeing this error in console:

Uncaught (in promise) TypeError: callback is not a function
    at pmtiles.js?v=415bef3a:722:11

Looks to be being triggered when I add source:

    map.addSource(`pluto-${y}`, {
      type: "vector",
      url: layerData.url,
    });

Running a Vite app.

{
  "name": "pluto-hist",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview --host 0.0.0.0 --port 8080"
  },
  "devDependencies": {
    "vite": "^4.4.5"
  },
  "dependencies": {
    "pmtiles": "2.11.0"
  }
}

Upgrading to 3.0.0-alpha.2 fixed the issue.

Let me know if I can provide any more info!

Are you on Maplibre 4.0.0 that was just released? pmtiles JS 2.x is not compatible, because the API changed; so only pmtiles 3.x+ supports MapLibre 4.x.

Perhaps we should make another minor release of 2.x with some message to upgrade.

You beat me to it. Yes, when I constrained maplibre to 3.6.2 the issue went away. A warning would be nice!