VectorTileLayer does not fetch tile beyond zoom level 16

413
1
Jump to solution
08-30-2019 05:49 AM
JeromeCauchon
New Contributor III

I'm using a VectorTileLayer with a vector tile service hosted in MapTiler. My tileset has been created for level 0 to 18. Unfortunaltly, when i'm zooming in over the level 16, the VectorTileLayer does not fetch tile. I tried with version 4.11 and 4.12. Here's a my source code: CodePen

Somebody have an idea how to make it work?

Thanks

0 Kudos
1 Solution

Accepted Solutions
JeromeCauchon
New Contributor III

By debugging the VectorTileLayer, i figured how to fix it.... When a VectorTileLayer is instantiated, it creates is own tileInfo. By default, the maximum zoom level is 16. If you want to override it, you have to add a maxzoom property in the source of your style JSON object.

var style = {
..
   "sources": {
      "07829d77-6e7c-4995-958c-b649a1ad336e": {
         "maxzoom": 24,
         "type": "vector",
         "tiles": ["https://api.maptiler.com/tiles/5dc6f056-32ca-4d32-95f1-7960e7dc7b09/{z}/{x}/{y}.pbf?key=DrAk6YxPY2rSlxgUxfpT"]
}
...
};

View solution in original post

0 Kudos
1 Reply
JeromeCauchon
New Contributor III

By debugging the VectorTileLayer, i figured how to fix it.... When a VectorTileLayer is instantiated, it creates is own tileInfo. By default, the maximum zoom level is 16. If you want to override it, you have to add a maxzoom property in the source of your style JSON object.

var style = {
..
   "sources": {
      "07829d77-6e7c-4995-958c-b649a1ad336e": {
         "maxzoom": 24,
         "type": "vector",
         "tiles": ["https://api.maptiler.com/tiles/5dc6f056-32ca-4d32-95f1-7960e7dc7b09/{z}/{x}/{y}.pbf?key=DrAk6YxPY2rSlxgUxfpT"]
}
...
};

0 Kudos