I have added to my OpenLayers-based app two layers. A google maps layer and another WMS layer.

physical = new OpenLayers.Layer.Google(
        "Physical View",
            {type: google.maps.MapTypeId.PHYSICAL,
                numZoomLevels: 21,
                MAX_ZOOM_LEVEL: 21,
                MIN_ZOOM_LEVEL: 6}

ktl = new OpenLayers.Layer.WMS( "Ktl","http://gis.ktimanet.gr/wms/wmsopen/wmsserver.aspx",
            layers: 'KTBASEMAP',
            //format: "image/png",
            //displayOutsideMaxExtent: false,
            projection: new OpenLayers.Projection("EPSG:900913"),

Both layers are displayed in my app but I face the following zoom-related problem. When I see the google maps layer the zoom level is different than when I see the WMS layer. I have added two screenshots which illustrate what I describe above.

enter image description here enter image description here

This is quite unexpected as I set the center and zoom of my map as:

map.setCenter (lonLat, 1);

Is it possible to change the default zoom of a layer?

1 Answer 1


For google maps sure you can typically set the intial zoom in mapOptions for creation

var mapOptions = {
     zoom: 4,
      center: new google.maps.LatLng(-25.363882, 131.044922)

 map = new google.maps.Map(document.getElementById('map-canvas'),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.