Skip to content

ol-pmtiles PMTilesVectorSource doesn't work with OpenLayers 10+ #656

@peter-alexander

Description

@peter-alexander

PMTilesVectorSource only works with OL 9, not with the current versions.

<script src="https://cdn.jsdelivr.net/npm/ol@v10.8.0/dist/ol.js"></script> <script src="https://unpkg.com/ol-pmtiles@2.0.2/dist/olpmtiles.js"></script>

Example from: https://github.com/protomaps/PMTiles/tree/main/openlayers

const vectorLayer = new ol.layer.VectorTile({
declutter: true,
source: new olpmtiles.PMTilesVectorSource({
url: "https://r2-public.protomaps.com/protomaps-sample-datasets/nz-buildings-v3.pmtiles",
attributions: ["© Land Information New Zealand"],
}),
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: "gray",
width: 1,
}),
fill: new ol.style.Fill({
color: "rgba(20,20,20,0.9)",
}),
}),
});
map.addLayer(vectorLayer);

util.js:29 Uncaught TypeError: Cannot read properties of undefined (reading 'ol_uid')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions