Ticket #353 (closed feature: worksforme)

Opened 7 years ago

Last modified 6 years ago

add getResolutionFromZoom() method to Map, Layer

Reported by: euzuro Owned by: sderle
Priority: minor Milestone: 2.4 Release
Component: Map Version:
Keywords: Cc:
State:

Description

Originally from tschaub's patch from #228:

Should we add a getResolutionFromZoom() method which allows user to specify a zoom level and get the corresponding resolution?

Change History

Changed 7 years ago by euzuro

my original thoughts (again from #228):

I would like to offer this functionality, but at least right now, we cannot put that fix in, because not all baselayers can support this functionality. baselayers whose resolutions arrays we calculate can of course do this and without problem, but the whole idea behind the FixedZoomLevels? functionality in use by 3rd party baselayers like google, ve, etc is that we *dont*know* the resolutions array and rather try to work around it.

Changed 7 years ago by euzuro

from chat with cr5:

I think that it may make sense to implement the function (although not for 2.2) and return a resolution for the zoom if we have it, and otherwise define what we're going to return: false, or null, or what have you

Changed 6 years ago by euzuro

  • milestone changed from 2.3 Release to 2.4 Release

Changed 6 years ago by crschmidt

I've thought about this some more -- isn't getResolutionFromZoom equivilant to:

layer.resolutions[0]?

If so, do we really need a wrapper around this?

Changed 6 years ago by sderle

  • status changed from new to closed
  • resolution set to worksforme
Note: See TracTickets for help on using tickets.