ahocevar/openlayers — comment on commit f2fbe02968c5d68208b467443517da19b19d4df5
File: lib/OpenLayers/Layer.js line 903
By tschaub:

Actually, I was envisioning doing this in [addOptions](https://github.com/ahocevar/openlayers/blob/f2fbe02968c5d68208b467443517da19b19d4df5/lib/OpenLayers/Layer.js#L481) where it currently pulls `maxResolution` from the projection defaults. Instead, in this same block, `maxResolution` would be calculated. Seems like that would make it simpler (keeping all the "derive other map properties from projection" logic in the same place).

And, while it probably won't make that much difference in practice, I think the convention for deriving `maxResolution` could be expressed like this:

// assume the world fits in a tile
props.maxResolution = Math.max(
this.maxExtent.getWidth() / tileSize.w, this.maxExtent.getHeight() / tileSize.h
);