HI !

i want to limit the maxScale and with the following code there is no limit zoom level - but in the view-area.

   rext = new OpenLayers.Bounds();
   rext.extend(lonLatToMercator(new OpenLayers.LonLat(-26,50.5)));
   rext.extend(lonLatToMercator(new OpenLayers.LonLat(34.5,66.9)));
   rext.toBBOX();

  map = new OpenLayers.Map ("map", {
    controls:[],
    //maxZoomScale: 5
    restrictedExtent: rext
     //maxScale: 10000
     });


with the subroutine

function lonLatToMercator(ll) {
   var lon = ll.lon * 20037508.34 / 180;
var lat = Math.log(Math.tan((90 + ll.lat) * Math.PI / 360)) / (Math.PI / 180);

   lat = lat * 20037508.34 / 180;

   return new OpenLayers.LonLat(lon, lat);
} // -- end lonLatToMercator


when i modify the top-code to limit the zoom-level to

   rext = new OpenLayers.Bounds();
   rext.extend(lonLatToMercator(new OpenLayers.LonLat(-26,50.5)));
   rext.extend(lonLatToMercator(new OpenLayers.LonLat(34.5,66.9)));
   rext.toBBOX();

  map = new OpenLayers.Map ("map", {
    controls:[],
    //maxZoomScale: 5,  // <---------------------- add delimeter ","
    restrictedExtent: rext
    maxScale: 10000  // <---------------------- add parameter
     });

there is a big mistake !!!

the coordinates of points will show corret but the show area of the tiles is wrong (example: for the coordinates of north germany the tiles of grönland will show!!!!)

can anybody help me ???

regards Jan :-)


_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to