New answers tagged

0

What's important to understand here is relationship between projection of the view and projection of the layer shown in the view, when projections differ. In the case of raster layer, OpenLayers does automatic on the fly reprojection of layer CRS to view CRS, but only if transformation is defined in projection definition, which is the case for all EPSG ...


0

This is still helping in 2020. Going through an OL 3 tutorial and to help me understand better I'm trying to also do them in OL 6


4

The line $sql='UPDATE signaletique SET infos="'.$_POST['maj_infos'].'"WHERE id="'.$_GET['feature-id'].'"'; is extremely bad. Seriously. Let's start with the gentle item: in Postgres, double quotes are used to specify an object name, in this case a field. The content of maj_infos is therefore interpreted as a field name, which likely does not exist. Then ...


2

Your map.getView().fit call does not get executed because sourceGeoBlog.once event processing function is defined after geoBlog vector layer is defined and loaded. Another thing (thanks to comment from @ahocevar) is wrong call to fit() function with three arguments. Function takes only two arguments, size has to be passed as size option. You should define ...


2

As specified in the docs of GeoServer : https://docs.geoserver.org/stable/en/user/services/wms/get_legend_graphic/index.html#content-dependent-legends Content dependent evaluation is enabled via the following LEGEND_OPTIONS parameters: countMatched: adds the number of features matching the particular rule at the end of the rule label (requires ...


1

I ran into CORS errors whilst using GetFeatureInfo requests to get info from a WMS geoserver layer in my OpenLayers map. Answer as of May 2020: https://docs.geoserver.org/latest/en/user/production/container.html#enable-cors


0

Thanks the indication from @TomazicM I've changed the resolution of the image from 10 meter to 0.5 meters and now I can see correctly the image until zoom level 19.


0

thanks to @Mike and @Ian Turton for their helpfull comments : The problem was in the view resolution. When sending a request with getFeatureInfoUrl function, it uses a small 50*50 extent map an thus it was returning only few features that intersects the center of the dragBox. So i neded to change from : viewResolution to : // Be sure to import { ...


2

Icons are only displayed for Point or MultiPoint geometry. To display Icons for Polygons the style must include a geometry function which returns a Point or MultiPoint (you would usually use the label points) let iconStyle = new Style({ geometry: function(feature) { let geometry = feature.getGeometry(); let geometryType = geometry.getType(...


1

In your original code you should change loader: to url: as the function doesn't load features, it simply returns a url with bbox parameter var signaletiqueSource = new ol.source.Vector({ //source signaletique WFS format: new ol.format.GeoJSON(), url: function(extent) { return 'http://localhost/cgi-bin/mapserv....


1

I found the solution if it can help someone. var signaletiqueSource = new ol.source.Vector({ //source signaletique WFS format: new ol.format.GeoJSON(), url:'http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/mapfile_rando.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=signaletique&...


3

You must either clone the geometry before transforming it, or you can specify projections as options to writeGeometry either wkt = format.writeGeometry(evt.feature.getGeometry().clone().transform('EPSG:3857',epsg)) or wkt = format.writeGeometry(evt.feature.getGeometry(), {dataProjection: epsg, featureProjection: 'EPSG:3857'});


0

There is a simple way if you want to disable all interactions at once: import Map from 'ol/Map' import Collection from 'ol/Collection' new Map({ ..., interactions: new Collection() })


2

I would go into the Layer Preview tab of the GeoServer admin console and select OpenLayers 3 (OL3) in the All Formats column. Then you can use the browser's devtools to see the network request and the parameters used to successfully display the image. You can also do a View Page Source in your browser to take a look at the exact OL3 code used to display ...


0

The package.json contanins "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "parcel -p 1995 index.html", "build": "parcel build --public-url . index.html" }, So if you run a test, it displays the said message and return with error code 1, which is what you are seeing. You can skip running the test, remove ...


Top 50 recent answers are included