[Users] GeoExt.plugins.PrintPageField and first map.addLayers ...don't see any vector extend.
Matt Priour
mpriour at kestrelcomputer.com
Thu Mar 17 12:29:35 CET 2011
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
Matt Priour
Kestrel Computer Consulting
From: konto gmail
Sent: Thursday, March 17, 2011 5:29 AM
To: users at geoext.org
Subject: [Users] GeoExt.plugins.PrintPageField and first map.addLayers ...don't see any vector extend.
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
_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110317/7a15cbbc/attachment.htm
More information about the Users
mailing list