import { useMemo } from "react";
import { ImageryLayer } from "resium";
import { WebMapServiceImageryProvider } from "cesium";

const url = "http://analysis.tpdc.ac.cn/gs/geoserver/phitrellis/wms";
const name = "phitrellis:4_3_2_a_sst_Layer11";

function SSTImageLayer() {
  const tempProvider = useMemo(
    () =>
      new WebMapServiceImageryProvider({
        url: url,
        layers: name,
        parameters: {
          service: "WMS",
          format: "image/png",
          transparent: true,
        },
      }),
    [name, url]
  );
  return (
    <ImageryLayer
      key={`ImageryLayer-${name}`}
      imageryProvider={tempProvider}
      show={true}
    />
  );
}

export default SSTImageLayer;
