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

Remove all resolutions guessing #44

Closed
tmcw opened this issue Nov 9, 2011 · 1 comment
Closed

Remove all resolutions guessing #44

tmcw opened this issue Nov 9, 2011 · 1 comment

Comments

@tmcw
Copy link
Contributor

tmcw commented Nov 9, 2011

Via this comment:

    // ok we want resolutions, here's our strategy:
    //
    // 1. if resolutions are defined in the layer config, use them
    // 2. else, if scales are defined in the layer config then derive
    //    resolutions from these scales
    // 3. else, attempt to calculate resolutions from maxResolution,
    //    minResolution, numZoomLevels, maxZoomLevel set in the
    //    layer config
    // 4. if we still don't have resolutions, and if resolutions
    //    are defined in the same, use them
    // 5. else, if scales are defined in the map then derive
    //    resolutions from these scales
    // 6. else, attempt to calculate resolutions from maxResolution,
    //    minResolution, numZoomLevels, maxZoomLevel set in the
    //    map
    // 7. hope for the best!

This is the cause of 95% of help requests I see around OpenLayers. There should be two modes: calculate based on zoom levels, and give a specific set of resolutions. This guessing is just too much cognitive overhead and magic to be anywhere near predictable for implementations.

@elemoine
Copy link
Member

elemoine commented Nov 9, 2011

Yeah, I wrote these lines when I reworked initResolutions. The rewrite was under b/w compatibility constraints obviously.

@tmcw tmcw closed this as completed Dec 15, 2014
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

No branches or pull requests

2 participants