New answers tagged

1

Try specifying extent in the OpenLayers layer settings (it needs to be in view projection units regardless of the projection the WMS is using) new ol.layer.Image({ source: new ol.source.ImageWMS({ ... }), extent: [-180, -90, 180, 90] })


1

I would put all of my data in a single table and make sure that it had a spatial index on the geometry column and conventional indexes on any attribute that you use for searching or in the style. I would then make sure the style prevented anyone drawing the layer at a scale above village size. No one needs to see the map for the whole country (the fields ...


0

You are trying to open an iframe, instead of it, you can have the data as JSON, parse, show. Try this: <head> <meta charset="UTF-8"> <link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css"> <script src="https://code.jquery.com/jquery-2.2.3....


2

That is the correct and expected behaviour, if you select several layers at the same time and add them to QGIS it will make one request for all of the selected layers and add them as a single QGIS layer. If you need to have the ability to turn individual layers on and off in QGIS then you must add the layers one at a time, this will make QGIS make several ...


2

Yes, you can create 3 separate styles with a filter that selects only the features you want styled. Or you can create one style with 3 rules each with a filter to select the required filters. In the first case, you will see only on type of polygons at a time (unless you request the layer more than once); in the second case you will see all three types of ...


3

Generally speaking a WMS gives singular images (or videos) on request (GetMap), so output formats will be normally, image/png, image/jpeg, image/tiff. A caveat would be use of WMS to serve MapBox vector tiles. A WMS is not a streaming service. The data the WMS converts into its output can be vector or raster, or some combination of those. The attribute ...


0

The map iis currently centered to default EPSG:3857 coordinates, it should be center: fromLonLat([-1.629950,42.63], customproj),


2

OpenLayers sets the CRS/SRS of a WMS from the projection specified in the source options, or if none is specified from the view projection so anything you put in params would be overriden (the API says WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically): source: new ol.source.TileWMS({ url: 'xxxxxxx', ...


1

I found the answer. Or rather QgsRasterLayer was updated to support QgsRasterLayer::setDataSource() so this works now: rasterlayer.setDataSource(uri, "LAYERNAME", "wms", QgsDataProvider.ProviderOptions()) Which is great.


1

Found an answer to this when searching around further today (specifically when looking at this question), using the ol.format.WMSCapabilities() class, using the code below: var url = "***my_wms_url**"; var GetCaps = new ol.format.WMSCapabilities(); fetch(url).then(function(response) { return response.text(); }).then(function(text) { var ...


2

Example of multiple WMS layers in a single OpenLayers layer For this service http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms?service=WMS&version=1.3.0&request=GetCapabilities this would display 2 of the 6 sublayers: source: new ol.source.TileWMS({ url: 'http://ogc.bgs.ac.uk/cgi-bin/...


Top 50 recent answers are included