[OpenLayers-Users] map bounds or projection problem?

Arnd Wippermann arnd.wippermann at web.de
Tue Aug 25 11:09:32 EDT 2009


Hi Eoinyp,

You have no navigation control added to your map.

map.addControl(new OpenLayers.Control.Navigation());

If you want use EPSG:26986, http://spatialreference.org/ref/epsg/26986/
shows the standard extent for that projection.

You can't mix layers with different projections in one map. You declare a
projection for your map and the layers will requested for this projection.
OpenLayers can't reproject raster layers.

In mymap2.html you should choose sphericalMercator (EPSG:900913) for the
projection of the map. As you have choosen for the google layer. See the OL
examples for the bounds of EPSG:900913 and resolution.

You try to compound a map with three different projections. I think, the map
projection is set to sphericalMercator by the google layer.

Regards,
Arnd

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von eoinyp
Gesendet: Dienstag, 25. August 2009 14:05
An: users at openlayers.org
Betreff: [OpenLayers-Users] map bounds or projection problem?


Hi list,
I am just getting started with openlayers and geoserver.
I have two simple wms layers being served by geoserver: a layer of US
states, and a layer of town boundaries in Massachusetts. Each of the layers
display fine on their own. Showing the full extent of the mapped area. When
I put them both together however, only a section of the States layer is
shown, while the full Mass layer is shown. It is not possible to pan and see
the rest of the States layer. 
I am not entirely sure what the problem is, so im not sure how to fix it!
The map with the states and the Mass towns layers here:
http://www.eoinmaca.com/maps/OpenLayers/mymap3.htm
I think it is a problem with the extent of the bounds of the  layers
defined. What should it be set to?
currently it is:  

var bounds = new OpenLayers.Bounds(
19012.0201171875, 768402.5875,
345695.3353515625, 968859.1625);

The layers have different EPSGs - is this a problem?

The problem is compounded when I add in a googleEarth baselayer. It shows
the full extent of the google layer, but when I zoom in I cant pan to the
Mass area. The pan functionality seems to be constrained to a small area.
The map with the google base layer is available here:
http://www.eoinmaca.com/maps/OpenLayers/mymap2.htm


If the bounds is the problem, is there a simple way of figuring out what the
bounds of my map need to be?

Many thanks,

Eoinyp


--
View this message in context:
http://n2.nabble.com/map-bounds-or-projection-problem-tp3509317p3509317.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list