[Users] GeoExt.plugins.PrintPageField and first map.addLayers ...don't see any vector extend.

konto gmail specjal at gmail.com
Thu Mar 17 14:07:04 CET 2011


ok.

so i try to add some layer (as base layers)


var layer2=new OpenLayers.Layer.WMS('layer_name','http://127.0.0.1:8888/geoserver/wms',{
            layers:'some_layer',
            srs:'ESPG:2173',
            transparent:true,
            tiled:'true',
            maxExtent:srs_bounds,
            format:'image/png'
        },{
            isBaseLayer:true,
            singleTile:false,
            visibility:true
        });

 var options = {
        projection: new OpenLayers.Projection("EPSG:900913"),
        displayProjection:new OpenLayers.Projection("EPSG:4326"),
        resolutions: [156543.03390625, 78271.516953125,
39135.7584765625, 19567.87923828125, 9783.939619140625,
4891.9698095703125, 2445.9849047851562, 1222.9924523925781,
611.4962261962891, 305.74811309814453, 152.87405654907226,
76.43702827453613, 38.218514137268066, 19.109257068634033,
9.554628534317017, 4.777314267158508, 2.388657133579254,
1.194328566789627, 0.5971642833948135, 0.29858214169740677,
0.14929107084870338, 0.07464553542435169, 0.037322767712175846,
0.018661383856087923, 0.009330691928043961, 0.004665345964021981],
        scales:[100000.0,75000.0,50000.0,25000.0,20000.0,15000.0,10000.0,5000.0],
        units: "meters",
        maxExtent: bounds,
        controls: [
        new OpenLayers.Control.Navigation(),
        new OpenLayers.Control.PanZoomBar(),
        new OpenLayers.Control.AiMousePosition()
        //new OpenLayers.Control.OverviewMap()
        ]
    };


 map = new OpenLayers.Map('map', options);
   map.addLayers([layer2]);
    layer2.setVisibility(false);


and after add print extend i don't see it....it works but can't see
orange background. I don't get any error message.




> don’t bother with all that resolution and scale setting (which by the way,
> if the map was really listening to, would need to match up, but resolutions
> take precedence over scales)
> The base layer (if you are using a base layer) will set the map resolution.
> You should set the maxExtent and maxResolution of the map to reasonable
> levels.
> It would be more helpful to see the bit of code which failed, not the one
> that works


More information about the Users mailing list