ismyrnow / Leaflet.functionaltilelayer

Leaflet tile layer with functionally defined URL and support for promises.
MIT License
72 stars 15 forks source link

maxNativeZoom in functional tile layer #7

Closed gwacker closed 10 years ago

gwacker commented 10 years ago

It seems I can pass minZoom and maxZoom as options into the functional tile layer, but passing in maxNativeZoom doesn't behave like it does in TileLayer

ismyrnow commented 10 years ago

I'm not seeing this behavior. I tried it out by extending the basic example with the following code:

funcLayer2 = new L.TileLayer.Functional(function (view) {
  return 'http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{y}/{x}.jpg'
    .replace('{z}', view.zoom)
    .replace('{x}', view.tile.row)
    .replace('{y}', view.tile.column);
  }, { maxNativeZoom: 10 });
map.addLayer(funcLayer2);

The result is as expected; the satellite tiles are only fetched up to layer 10, and beyond that, they are scaled client-side.

I'm going to close this for now, but feel free to provide an example (jsbin/jsfiddle) if you feel the issue is still there.