Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use zoom parameter if passed #5822

Merged
merged 1 commit into from
Oct 9, 2017
Merged

Conversation

broncha
Copy link
Contributor

@broncha broncha commented Oct 4, 2017

We have an offline layer, which caches the tiles and we need to generate URL for various zoom level (https://github.com/mWater/offline-leaflet-map). We did override this method there but I think this should also be supported in leaflet itself!

It only supplies the z parameter from the current zoom level of the map right now

@cherniavskii cherniavskii merged commit 93be1ae into Leaflet:master Oct 9, 2017
@lpikora
Copy link

lpikora commented Jan 15, 2018

Unfortunately it breaks TileLayer's zoomOffset option. #6004

@ghybs
Copy link
Collaborator

ghybs commented Jan 15, 2018

Hi,

Thank you @lpikora for pointing out that PR!

we need to generate URL for various zoom level

Sounds to me that the proper place for such a modification / override for that purpose might have been in _getZoomForUrl method then.

But in the first place, I think we could have spotted the regression earlier should this PR have been first reported as an issue, with all required information in it (in particular: Leaflet version, bug description and minimal test case reproduction), and this PR had included a test spec.

Follow-up of corrective action in issue #6004.

yohanboniface added a commit that referenced this pull request Dec 28, 2023
cf #6004 #6006

Before this change, `coords.z` would not taken into account, and
was always overriden by `this._tileZoom`.
In the normal flow, `coords.z` is anyway set from `this._tileZoom`
before `getTileUrl` is called (in GridLayer._update). But this
prevents using `getTileUrl` out of this `_update` method.
There are some scenarios where this is needed (see #5822), or
(which is the case in uMap) when wanting to display a tile as
a tilelayer preview.
yohanboniface added a commit that referenced this pull request Dec 28, 2023
cf #6004 #6006

Before this change, `coords.z` would not taken into account, and
was always overriden by `this._tileZoom`.
In the normal flow, `coords.z` is anyway set from `this._tileZoom`
before `getTileUrl` is called (in GridLayer._update). But this
prevents using `getTileUrl` out of this `_update` method.
There are some scenarios where this is needed (see #5822), or
(which is the case in uMap) when wanting to display a tile as
a tilelayer preview.
yohanboniface added a commit that referenced this pull request Dec 28, 2023
cf #6004 #6006

Before this change, `coords.z` would not taken into account, and
was always overriden by `this._tileZoom`.
In the normal flow, `coords.z` is anyway set from `this._tileZoom`
before `getTileUrl` is called (in GridLayer._update). But this
prevents using `getTileUrl` out of this `_update` method.
There are some scenarios where this is needed (see #5822), or
(which is the case in uMap) when wanting to display a tile as
a tilelayer preview.
Falke-Design pushed a commit that referenced this pull request Jul 7, 2024
cf #6004 #6006

Before this change, `coords.z` would not taken into account, and
was always overriden by `this._tileZoom`.
In the normal flow, `coords.z` is anyway set from `this._tileZoom`
before `getTileUrl` is called (in GridLayer._update). But this
prevents using `getTileUrl` out of this `_update` method.
There are some scenarios where this is needed (see #5822), or
(which is the case in uMap) when wanting to display a tile as
a tilelayer preview.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants