0

My default map is in EPSG: 5179 coordinate system, and I'm using tileurlfunction with redefinition.

The view projection is also set to 5179.

Projection of Geoserver WMS layers to EPSG: 4326 or EPSG: 3857 On request it will overlay on my base map.

But if I modify the projection to EPSG: 5179 and override the tilegrid value, tileurlfunction, it doesn't overlay normally.

If you look at ol v6.0.0.md,

New internal tile coordinates,

It seems to be a problem caused by the modification of the tileUrlFunction on the part.

If tilegrid does not use Top-Left and applies Bottom-Left, it would be appreciated if you could let me know how to do WMS layer service.

  • My baselayer&tileurlfunction
tilegrid
    origin: bottom-left,
    resolutions,
    extent

tileurlfunction
    return (
          (tileCoord) => {
            if (!tileCoord) {
              return undefined;
            } else {
              return template..replace(zRegEx, tileCoord[0].toString())
                .replace(xRegEx, tileCoord[1].toString())
                .replace(yRegEx, (-tileCoord[2] - 1).toString());
            }
          }
    );
  • Geoserver wmslayer
    const tileGrid = new TileGrid({
        origin: [extent[0], extent[1]],
        resolutions,
      extent
    })

    const wmsSource = new TileWMS({
        url: 'http://domain/geoserver/wms',
        params: { LAYERS: 'test:ecl_sw_p', TILED: true },
        projection: 'EPSG:5179'
        tileGrid
      })
Chad.K
  • 65
  • 1
  • 5

1 Answers1

0

I solved it.

proj4js EPSG:5181
+axis=enu
                 =>
+axis=neu

Change the upper left corner in the above way.

// ol/source/TileWMS.js
if (this.v13_ && axisOrientation.substr(0, 2) == 'ne') {
      let tmp;
      tmp = tileExtent[0];
      bbox[0] = tileExtent[1];
      bbox[1] = tmp;
      tmp = tileExtent[2];
      bbox[2] = tileExtent[3];
      bbox[3] = tmp;
}
Chad.K
  • 65
  • 1
  • 5