Skip to content

use of shortbread-tiles with OpenLayers #20

@vprint

Description

@vprint

I have an OpenLayers project which should run only on local.

I downloaded the experimental vector tile package over Niger from geofabrik (https://download.geofabrik.de/africa/niger-shortbread-1.0.tar.gz). and unzipped the file in /src/data/vectorTiles.

When i try to add the tiles in openLayers, i have the following error :

index.js:211 Uncaught Error: Unimplemented type: 3
  at Pbf.skip (index.js:211:20)
  at Pbf.readFields (index.js:46:45)
  at layersPBFReader (MVT.js:318:9)
  at Pbf.readFields (index.js:44:13)
  at MVT.readFeatures (MVT.js:260:27)
  at xhr2.onload (featureloader.js:107:20)

Here is my openLayers code :

  static createVectorTileLayer(layerParam: ILayerSettings): VectorTileLayer {
    return new VectorTileLayer({
      source: new VectorTileSource({
        format: new MVT({
          layers: ['streets'],
        }),
        url: layerParam.url,
        attributions: layerParam.attribution,
      }),
      properties: {
        name: layerParam.name,
      },
      zIndex: layerParam.zindex,
      visible: layerParam.visible,
    });
  }

for information my layerParam.url is 'src/data/vectorTiles/vector/{z}/{x}/{y}.pbf'.

Any idea on how to correct it ?

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