[Users] GeoExt.plugins.PrintPageField and first map.addLayers ...don't see any vector extend.
konto gmail
specjal at gmail.com
Thu Mar 17 11:29:32 CET 2011
Hi
I try to add some print extend vector layer to my map. When i add
first layer to map (which is OpenLayers.Layer.OSM() ) , my print
extend layer is visible...but when i try to add another (which has
maxzoom > 18 ) my print extend layer don't show.
Question: How should look like code who will add my wms layer as basic
layer. I think that Geoext need some extra info (resolution, bounds
etc).
Sample code - it works - but how to add another WMS layer (replace OSM layer)
var mapnik = new OpenLayers.Layer.OSM()
var options = {
projection: new OpenLayers.Projection("EPSG:900913"), //2177
//4326 //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()
],
eventListeners : {
"moveend" : function() {
printPage.setCenter(new
OpenLayers.LonLat(map.getCenter().lon,map.getCenter().lat));
}
}
};
map = new OpenLayers.Map('map', options);
map.addLayers([mapnik]);
mapnik.setVisibility(false);
it works fine
More information about the Users
mailing list