diff --git a/src/Map.jsx b/src/Map.jsx deleted file mode 100644 index e9c7cd3..0000000 --- a/src/Map.jsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { useRef, useEffect } from "react"; -import { loadModules } from "esri-loader"; -import esriConfig from "@arcgis/core/config"; -esriConfig.apiKey = - "AAPK9928ede1767b45ac9580fcf5d81db099rEWnuzCXUeor-FPlge6bydprGlILUxdTVtlVLso0ngwUt2OnR0As2NeUJlXsmRD6"; -function Map() { - const MapEl = useRef(null); - - useEffect(() => { - let view; - loadModules(["esri/views/MapView", "esri/Map"], { - css: true, - }).then(([MapView, Map]) => { - const map = new Map({ - // Map - basemap: "arcgis-topographic", - }); - view = new MapView({ - // basically the div container - map: map, - center: [], - zoom: 8, - container: MapEl.current, // Connection to div element below - }); - }); - return () => { - if (!!view) { - view.destroy(); - view = null; - } - }; - }); - return
; -} - -export default Map;