question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

load geoserver wms through ol/source/ImageWMS, after webpack does't work

See original GitHub issue
import OLLayerTile from 'ol/layer/Tile.js';
import OLLayerImage from 'ol/layer/Image.js';
import OLSourceImageWMS from "ol/source/ImageWMS";
import OLSourceTileWMS from "ol/source/TileWMS";
const exports = {};


exports.GeoServerTiled=function (visiable,url) {
  return new OLLayerTile({
     title: 'geoserver wms',
     visible:visiable,
     source: new OLSourceTileWMS({
        projection: 'EPSG:4326',
        crossOrigin: 'anonymous',
        params: {'LAYERS': 'xxx'},
        url: url
     })
  });
}
exports.GeoServerUntiled=function (visiable,url) {
  return new OLLayerImage({
     title: 'geoserver wms',
     visible:visiable,
     source: new OLSourceImageWMS({
        projection: 'EPSG:4326',
        crossOrigin: 'anonymous',
        params: {'LAYERS': 'xxx'},
        url: url
     })
  });
}

export default exports;

I use the GeoServerTiled method all works.

But I use GeoServerUntiled I debug in es6 envirement, 2d or 3d it all works. but, after webpack 2d work, but 3d does’t work.

Is the reason webpack problem or something else? Any help thank u.

ol version:5.3.0 cesium version:1.64 ol-cesium:2.9.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mulfvikcommented, Aug 24, 2021

Hi, anyone solved their issue? Having the same problem in a webpack setup. It’s a node project and importing ol-cesium/cesium like this: import OLCesium from 'olcs/OLCesium'; import * as Cesium from 'cesium'; window.Cesium = Cesium; Map resolutions like this: "resolutions": [ 156543.03, 78271.52, 39135.76, 19567.88, 9783.94, 4891.97, 2445.98, 1222.99, 611.50, 305.75, 152.87, 76.437, 38.219, 19.109, 9.5546, 4.7773, 2.3887, 1.1943, 0.5972 ],

The map is based on openlayers 6.5.0 and using ol-cesium 2.13.0/cesium 1.84.0 for 3d. Background map is openstreetmap and renders properly. GeoJSON also renders properly in 3d. When it comes to WMS it doesnt render in 3d view, only in 2d view. Projection EPSG:3857 without any reprojections in client. When requesting a WMS service in 3d view the response is 200 and the images are there in the response but they does not show in viewer.

0reactions
mulfvikcommented, Jul 19, 2022

@gberaudo Have not been able to fix this, you might have suggestion on how to proceed? This is the request response in 2D view image image And this is response in 3D view image image

Read more comments on GitHub >

github_iconTop Results From Across the Web

GeoServer WMS layer won't load on OpenLayers 5
shp in a PostGIS database using shp2pgsql, then imported the db into GeoServer; the layer works fine with the preview provided by GeoServer....
Read more >
openlayers - Bountysource
load geoserver wms through ol/source/ImageWMS, after webpack does't work $ 0 ... WMS Layer doesn't work well in ol-cesisum 3d when set projection...
Read more >
WMS Layer not rendered properly on all zoom levels
The layers are displayed properly in GeoServer itself and when add them to qGIS. I use this setup and code for other layers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found