[OpenLayers-Users] Overlay layer minscale

Diego Guidi diegoguidi at gmail.com
Mon Mar 31 12:36:56 EDT 2008


> Hello,
Hi Roberto :)
UgiDotNet loves OpenLayers ;)

> I made a map with Google Maps as base layer, and a wms service as overlay.
> at the minimum google scale the wms layer switched off automatically and I
> don't know why.
> i tried to set the minimum resoloution as a very low value, but nothing
> changes.
Using google as base layer is a good thing, but looks that introduces
a limit on scales that you could use.
I'm playing with google+wms+openlayers and the best results for me are
using this parameters:

1) Add this values to map initialization:
maxRes = 156543.0339; // the max resolution for google layers
minZoom =  8;
maxZoom = 20; // Play with this values for a better initialization
resolutions =
[
    156543.0339,
    78271.51695,
    39135.758475,
    19567.8792375,
    9783.93961875,
    4891.969809375,
    2445.9849046875,
    1222.99245234375,
    611.496226171875,
    305.7481130859375,
    152.87405654296876,
    76.43702827148438,
    38.21851413574219,
    19.109257067871095,
    9.554628533935547,
    4.777314266967774,
    2.388657133483887,
    1.1943285667419434,
    0.5971642833709717,
    0.29858214168548586
]; // Values of google layers

2) When you've created the map object, added your layers and set the
base layer, use something like this:
wms.resolutions   = resolutions;  // change wms resolutions to fit
with google resolutions, so the scales are fixed



More information about the Users mailing list