Vector-Tiles-Google-Maps
Vector-Tiles-Google-Maps copied to clipboard
Error with tileSize = 512
Hi.
If I use tileSize=512 then need to fix getTileId
function in MVTSource, change parameter zoom
to zoom-1
getTileId(zoom, x, y) { return [zoom - 1, x, y].join(":"); }
I have not tested it with tiles different to 256. Can you provide a public source to do some test at 512?
Hi. Thanks for sharing the great source code.
I have Vector Tile service according to MVT specification, for MVT and tileSize=512 (default) the first zoom level is from zoom=0
which covers the whole world, corresponding to zoom=1
for tileSize =256.
So I just recalculated the zoom level to match the service path as I shared above.
I'm just trying with localhost. This is the image I tried:
Mercator library divides tiles in hardcoded 256
getTileAtLatLng: function (latLng, zoom) { var t = Math.pow(2, zoom), s = 256 / t, p = this.fromLatLngToPoint(latLng); return { x: Math.floor(p.x / s), y: Math.floor(p.y / s), z: zoom }; }
probably something to check.