protomaps-leaflet icon indicating copy to clipboard operation
protomaps-leaflet copied to clipboard

"Unimplemented type: 3" error in protomaps.min.js

Open EricGrange opened this issue 3 years ago • 4 comments

Just downloaded a small map

https://protomaps.com/downloads/small_map/a6f512ca-0157-4ca0-8229-9aecb99dc75b

and placed the files on a server, it "works", but with occasional blank tiles (that go away when scrolling or refreshing), and the console log fills up with "Unimplemented type: 3".

The bundled files refer to https://unpkg.com/[email protected]/dist/protomaps.min.js which seems to be quite outdated judging by the versions in the commits here.

EricGrange avatar May 13 '22 12:05 EricGrange

This can be fixed by changing the js & css references to

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script src="https://unpkg.com/[email protected]/dist/protomaps.min.js"></script>

and the layer assignment line in the js to

layer = protomaps.leafletLayer({attribution:'<a href="https://protomaps.com">Protomaps</a> © <a

so it appears it's just the download script on the server that is out of date

EricGrange avatar May 13 '22 12:05 EricGrange

@EricGrange thanks, I've updated the leaflet.html and gl.html to the latest versions, protomaps v1.19.0 and pmtiles v 1.0.4. Can you give it another try to ensure it's working?

bdon avatar May 17 '22 06:05 bdon

Hmmm, I tried "Refresh Map" on the first link, and it did nothing. The devtools console log shows the following error

main.2e0a4e319ff223bc32c14fb97b67b0469cee16c5.js:15          POST https://protomaps.com/downloads/small_map 403

EricGrange avatar May 18 '22 13:05 EricGrange

@EricGrange this should be fixed now as well, was missing CSRF tokens on that page.

bdon avatar May 25 '22 06:05 bdon

The download server now doesn't include bundled code to avoid this issue; please refer to the examples in this repo which will have the latest major/minor/patch version specified.

bdon avatar Dec 13 '22 07:12 bdon