2

Committing changes stops working after changing the basemap from OSM (as a WMS) to Bing maps (or Google or even OSM as a "OpenLayers.Layer.OSM") PS: All my layers are on 3857 Here's the Error :

...
ext>org.geotools.referencing.operation.projection.PointOutsideEnvelopeException: -375375
.85085794 outside of (-180.0,180.0)
Parsing failed for LineString: org.geoserver.wfs.WFSException: org.geotools.referencing.operation.projection
.PointOutsideEnvelopeException: -375375.85085794 outside of (-180.0,180.0)
org.geotools.referencing.operation.projection.PointOutsideEnvelopeException: -375375.85085794 outside
of (-180.0,180.0)
...

(See the screenshots) With OSM Update of the BingMaps

...
store: new GeoExt.data.WMSCapabilitiesStore({
url:
"/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1",
autoLoad: true
}),
},
...    
extent: OpenLayers.Bounds.fromArray([
-389443.8438372187,3795830.778190598 ,
-361613.60599175736,3828780.6685322397
]),

layers: [new OpenLayers.Layer.Bing({
name: "Bing Hybrid",
key: "AtiDbrNiSbYFAW0azuAZHQLgk5ULkZIOqWyKW4IfkY9q3uhDuCZh6Av7aOOUOs9Q",
type: "AerialWithLabels",
Projection : "EPSG:3857"
})
/*
new OpenLayers.Layer.WMS(
         "OpenStreetMap WMS",
        "https://ows.terrestris.de/osm/service?",
        {layers: 'OSM-WMS'}
        )
new OpenLayers.Layer.Google(
"Google Satellite", {
type: google.maps.MapTypeId.SATELLITE, 
 numZoomLevels: 25
})*/],

});
...

text: "Save",
handler: function() {
    app.featureGrid.store.proxy.protocol.commit(
        vectorLayer.features, {
            callback: function() {
                selectedLayer.redraw(true);
                    app.featureGrid.store.reload();
                                    }
                                });
            }
}]});

    ...
var schema = new GeoExt.data.AttributeStore({
url: url,
baseParams: {
"SERVICE": "WFS",
"REQUEST": "DescribeFeatureType",
"VERSION": "1.1.0",
"TYPENAME": layer.params.LAYERS
},
autoLoad: true,
listeners: {
"load": function(store) {
app.featureGrid.setTitle(layer.name);
selectedLayer = layer;
configureGrid(store, url);
}
}
});

...

app.featureGrid.reconfigure(new GeoExt.data.FeatureStore({
autoLoad: true,
proxy: new GeoExt.data.ProtocolProxy({
protocol: new OpenLayers.Protocol.WFS({
url: url,
version: "1.1.0",
featureType: rawAttributeData.featureTypes[0].typeName,
featureNS: rawAttributeData.targetNamespace,
srsName: "EPSG:3857",
geometryName: geometryName,
maxFeatures: 25000,
})
}),
fields: fields
}),

...
  • 1
    How to help if you paste here all these code lines ? – WKT Jun 9 '16 at 18:29
  • Thanks for your response, That's the problem, I don't know where it is, since it works fine with OSM but not Bing or Google map... – Oualid Fouad Jun 9 '16 at 18:33
  • 2
    We really need to see the xml you're posting to geoserver and what the error is – Ian Turton Jun 9 '16 at 19:17
  • How can I get it for you? – Oualid Fouad Jun 9 '16 at 20:46
  • I always get downvoted... What's not clear about my question? ask me to edit it (i did) rather than just block it for me. – Oualid Fouad Jun 9 '16 at 23:52
1

The most likely issue is projections - OpenLayers sets the projection of the map to match the projection of the base layer. Google and Bing will (always) use epsg:3857 while the OSM server you have chosen is a WMS server and if you check the GetCapabilities you will see it can serve maps in the following projections:

<SRS>EPSG:900913</SRS>
<SRS>EPSG:3857</SRS>
<SRS>EPSG:25832</SRS>
<SRS>EPSG:25833</SRS>
<SRS>EPSG:29192</SRS>
<SRS>EPSG:29193</SRS>
<SRS>EPSG:31466</SRS>
<SRS>EPSG:31467</SRS>
<SRS>EPSG:31468</SRS>
<SRS>EPSG:32648</SRS>
<SRS>EPSG:4326</SRS>
<SRS>EPSG:4674</SRS>
<SRS>EPSG:3068</SRS>
<SRS>EPSG:2100</SRS>
<SRS>EPSG:3034</SRS>
<SRS>EPSG:3035</SRS>
<SRS>EPSG:31463</SRS>
<SRS>EPSG:4258</SRS>
<SRS>EPSG:4839</SRS>
<SRS>EPSG:2180</SRS>
<SRS>EPSG:21781</SRS>
<SRS>EPSG:2056</SRS>

I suspect (but haven't checked) that OpenLayers defaults to epsg:4326 (lat/lon) if you don't specify what you want the projection of a WMS layer to be. There are two possible fixes:

  1. use the OpenLayers OSM layer which will use 3857 or
  2. set the projection of your WMS layer to epsg:3857.
  • Thank you for your response, The problem isn't with the OSM actually, Editing with an OSM as a Base layer is Irrelevant. I need Either Google Sat or Bing Maps and in order to do so, I Projected all my work to the EPSG:3857 without success with it. – Oualid Fouad Jun 10 '16 at 11:35
1

The solution was actually pretty easy ! All I had to do is set "projection: new OpenLayers.Projection("EPSG:3857")" in the MapPanel section.

...
map: {
numZoomLevels: 25,
controls: controls,
projection: new OpenLayers.Projection("EPSG:3857")
},
...
  • Nope, I was talking about Bing Maps and Google Maps, not OSM – Oualid Fouad Jun 15 '16 at 12:23
  • My WMS Layer was already in 3857, in fact All the layers and the Base Maps were in 3857, The trick here is to set the "map" in 3857 too, and by "Map" I mean the openlayers environment that I work on. Basically it had nothing as a projection (or 4326 as default). – Oualid Fouad Jun 15 '16 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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