map quality fixing
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import ImageElement from "@arcgis/core/layers/support/ImageElement.js";
|
||||
import Graphic from "@arcgis/core/Graphic";
|
||||
import { MapLayerContext, MapMediaLayerContext } from "./MapViewContext";
|
||||
|
||||
export const MapImage = (graphicProperties: __esri.ImageElementProperties) => {
|
||||
const { imagesLayer } = useContext(MapMediaLayerContext);
|
||||
const [image, setImage] = useState<__esri.ImageElement | undefined>();
|
||||
|
||||
useEffect(() => {
|
||||
const imagePoint = new ImageElement(graphicProperties);
|
||||
|
||||
setImage(imagePoint);
|
||||
}, [graphicProperties, imagesLayer]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!image || !imagesLayer) return;
|
||||
imagesLayer.source.elements.add(image);
|
||||
}, [image, imagesLayer]);
|
||||
|
||||
return <></>;
|
||||
};
|
||||
Reference in New Issue
Block a user