You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
758 B
20 lines
758 B
import { useState, useEffect, useContext } from 'react'
|
|
import GlobalContext from '../../../../utils/GlobalContext';
|
|
import { MapContext } from '../MapContext';
|
|
export default function ImageLayer(props) {
|
|
const { xyzImageOpts } = useContext(GlobalContext);
|
|
const { viewer } = useContext(MapContext);
|
|
|
|
useEffect(() => {
|
|
if (viewer) {
|
|
let l = new window.Cesium.UrlTemplateImageryProvider({
|
|
...xyzImageOpts
|
|
// maximumLevel: 18,
|
|
// url: xyzImageryUrl || 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'
|
|
});
|
|
viewer.imageryLayers.addImageryProvider(l);
|
|
}
|
|
}, [viewer, xyzImageOpts])
|
|
|
|
return null;
|
|
} |