BMcBride wrote:
>
> Hmmmm. OK- try viewing the source code from your GeoServer preview and
> grab the var bounds and var options bits. Something like this:
> var bounds = new OpenLayers.Bounds(
> -79.762, 40.496,
> -71.856, 45.016
> );
> var options = {
> controls: [],
> maxExtent: bounds,
> maxResolution: 0.0308828125,
> projection: "EPSG:4326",
> units: 'degrees'
> };
> map = new OpenLayers.Map('map', options);
> Update your script with these bits and add the following after your
> controls:map.zoomToExtent(bounds);
>
Your right that this does work, but the reason I was avoiding doing this was
because I want to be able to create a map with all different kinds of
layers. A PostGIS layer from my Geoserver, one from the Google API, a
GeoTIFF from my Geoserver and so on and so forth. When I grab the code from
Geoserver this way, it only sets the bounds of that one layer and then
nothing else displays properly. I have read the spherical mercator docs
which say to do this for my options variable:
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
};
but then this takes me back to the same issues of my Geoserver and any other
layers not working :(
Thanks,
elshae
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Geoserver-WMS-Layer-Does-Not-Display-tp5511643p5514798.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users