Bukhtiar Mohsin
Bukhtiar Mohsin

Reputation: 5

leaflet js + gMapCatcher tiles at zoom -2 not rendering

I am using leaflet js with gmapcatcher. I read the answer of the following question:

https://stackoverflow.com/questions/18695623/leaflet-gmapcatcher-change-zxy-template#=

It helped me a great deal. There is one small problem though and i just cant seem to get around that. The tiles i have downloaded using gmapcatcher are for zoom levels -2 to 1 for a small region surrounding an office. The solution suggested in the above mentioned question, works well for the zoom levels 16 17 and 18 for leaflet (zoom -1 0 and 1 for the gmapcatcher tiles) but when i zoom in further to level 19 it just fails to render the tiles and displays grey background. I have looked into the leaflet.js file and the getTileUrl function. all the tiles resulting from this function...

getTileUrl: function (t) {
    return L.Util.template(this._url, L.extend({
        s: this._getSubdomain(t),
        z: t.z,
        x: t.x,
        y: t.y,
        z0: 17-t.z,
        x0: Math.floor(t.x/1024),
        x1: Math.floor(t.x%1024),
        y0: Math.floor(t.y/1024),
        y1: Math.floor(t.y%1024)
    }, this.options))
},

are present in the corresponding folders. Can someone suggest what i am overlooking?

Upvotes: 0

Views: 248

Answers (1)

IvanSanchez
IvanSanchez

Reputation: 19089

Make sure to set the maxZoom option on your tilelayer. The default value, as it stands in the documentation, is 18. Pay attention to the maxNativeZoom option also.

Upvotes: 1

Related Questions