Code Monkey home page Code Monkey logo

Comments (5)

ahocevar avatar ahocevar commented on May 23, 2024

This is expected, because the zoom levels are derived from the world width fitting a single tile. For MVT, the default is 512 pixels, for WMTS/XYZ 256. So what's zoom 0 on a MVT standard source is zoom 1 on a WMTS/XYZ standard source.

from openlayers.

AnthonyGlt avatar AnthonyGlt commented on May 23, 2024

Thank you for your answer. I'm trying to find some doc specifying the size of mvt tile. Is that a norm, is there a way to know which size is the MVT source ?
Thank you

from openlayers.

ahocevar avatar ahocevar commented on May 23, 2024

Yes there is - for the source you linked, the metadata is here: https://data.geopf.fr/tms/1.0.0/PLAN.IGN/:

<TileFormat width="256" height="256" mime-type="application/x-protobuf" extension="pbf"/>

And as you an see, the advertised tile size is 256x256px. So you need to configure the VectorTile source with {tileSize: 256}, because the default is 512.

from openlayers.

AnthonyGlt avatar AnthonyGlt commented on May 23, 2024

Thank you, it seems that it was the olms lib (not updated) which was changing the size of the tile from 256 to 512 when applying the style. I'll try with a newer version.
Thanks !

from openlayers.

ahocevar avatar ahocevar commented on May 23, 2024

You have to set the tileSize to 256 manually, because 512 is the default and ol-mapbox-style does not read TMS metadata.

from openlayers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.