amir jahan
amir jahan

Reputation: 11

An error occurred in "WebMapServiceImageryProvider": Failed to obtain image tile X: 1 Y: 0 Level: 0

i have 2 images .tiff and serve the rgb with geoserver and for second image i use global mapper for "Cesium tile format" and the result is folder with x/y/z.terrian files

my geoserver image is correctly and other image with global mapper checked and its correct too now i want show the rgb image as 3d in cesium but i have an error in console.log: An error occurred in "WebMapServiceImageryProvider": Failed to obtain image tile X: 1 Y: 0 Level: 0.

An error occurred in "WebMapServiceImageryProvider": Failed to obtain image tile X: 2 Y: 0 Level: 1.

i check cors first and it's correct too and have not any problem and i can load tiles/layer.json correct i want show my rgb image (serve with geoserve) as 3d in ceium my code:

import { useRef } from "react";
import { Viewer, ImageryLayer, Cesium3DTileset } from "resium";
import { WebMapServiceImageryProvider, WebMercatorTilingScheme } from "cesium";

function App() {
  const ref = useRef(null);

  // Set up the WMS Imagery provider
  const imageryProvider = new WebMapServiceImageryProvider({
    url: "http://my ip:my geoserver port/geoserver/ThreeD/wms",
    layers: "ThreeD:Ortho",
    parameters: {
      service: "WMS",
      version: "1.1.0",
      request: "GetMap",
      styles: "",
      format: "image/png",
      srs: "EPSG:4326",
      transparent: true,
      tilingScheme: new WebMercatorTilingScheme()
    },
  });

  return (
    <Viewer full ref={ref}>
      {/* Imagery Layer for WMS */}
      <ImageryLayer imageryProvider={imageryProvider} />

      {/* Load the 3D Tileset (Terrain) */}
      <Cesium3DTileset
        url="http://my ip:my tile port/tiles/layer.json"  // Replace with your layer.json URL
        onReady={(tileset) => {
          ref.current?.cesiumElement?.zoomTo(tileset);  // Zoom to the tileset when ready
        }}
      />
    </Viewer>
  );
};

export default App;

please help me for fix it

Upvotes: 1

Views: 18

Answers (0)

Related Questions