0

I retrieve the bbox of my main Layer via GetCapabilities.

Now, if I instantiate my map like this, I would expect to have the map centered within the bbox.

map = new OpenLayers.Map({
    div : "map",
    projection :  new OpenLayers.Projection("EPSG:31466");
    units : "m",
    maxResolution : 2,
    maxExtent : new OpenLayers.Bounds(bbox)
});

However, when I do it like this, the map is displayed in the upper right corner. Even stranger, when I put markers on the edges of the bounding box, the upper right corner is very far away and the lower left is not visible at all. (See picture, the red markers are the markers on the edge of a hard-coded bounding box that I use and that I want to replace by a Server-generated Version, the green marker is the upper right of my layers bounding box according to GetCapabilities).

enter image description here

EDIT:

The bounding box that getCapabilties sends: [360000, 5770215.8928236235, 365000, 5770804.068148668]

The bounding box that is hard-coded (red markers): [363060,5770362,363496,5771118]

3
  • Impossible to answer before you show us the bounding box that GetCapabilities is sending. The request is like demo.opengeo.org/geoserver/…. If you use version=1.1.1 you must save the response on disk and open it with text editor.
    – user30184
    Feb 13, 2015 at 13:04
  • the bounding box that getCapabilties sends: [360000, 5770215.8928236235, 365000, 5770804.068148668]
    – Lokomotywa
    Feb 13, 2015 at 13:07
  • the bounding box that is hard-coded (red markers): [363060,5770362,363496,5771118]
    – Lokomotywa
    Feb 13, 2015 at 13:07

1 Answer 1

1

Something seems to be wrong with your coordinates or the assigned EPSG-Code. EPSG 31466 is the "Gauß Krüger Zone 2"-CRS. The first number of the x-Values is the number of the (Gauß-Krüger-)zone, which means that your x-values would have to beginn with a 2. The central median is at 2.500.000,000 plus/minus 3 degrees. Your x-value should also have 7 numbers and not only 6. for further information please have a look at http://wiki.openstreetmap.org/wiki/DE:Gau%C3%9F-Kr%C3%BCger#Format (only available in german) https://en.wikipedia.org/wiki/Gauss%E2%80%93Kr%C3%BCger_coordinate_system

I guess that these coordinates are EPSG 25832-coordinates (ETRS89 UTM 32N). If so you would just have to assign the correct EPSG in Geoserver and adapt your javasript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.