Skip to content

Instantly share code, notes, and snippets.

@jaredmcqueen
Created August 1, 2025 20:30
Show Gist options
  • Save jaredmcqueen/8391cf5cc63ac413e3a80de1de4ec7bf to your computer and use it in GitHub Desktop.
Save jaredmcqueen/8391cf5cc63ac413e3a80de1de4ec7bf to your computer and use it in GitHub Desktop.
next.js linting errors with arcgis
"use client";
import { useEffect, useRef } from "react";
import "./index.css";
// Individual imports for each component used in this sample
import "@arcgis/map-components/components/arcgis-map";
import "@arcgis/map-components/components/arcgis-zoom";
import "@arcgis/map-components/components/arcgis-legend";
import "@arcgis/map-components/components/arcgis-search";
// Core API import
import Graphic from "@arcgis/core/Graphic.js";
export default function MapPage() {
const handleViewReady = (event: any) => {
const viewElement = event.target;
const point = {
type: "point" as const,
longitude: -118.38,
latitude: 33.34,
};
const markerSymbol = {
type: "simple-marker" as const,
style: "triangle" as const,
size: 15,
color: "red",
outline: {
color: "white",
width: 2,
},
};
const pointGraphic = new Graphic({
geometry: point,
symbol: markerSymbol,
});
viewElement.graphics.add(pointGraphic);
};
return (
<div className="w-full h-screen">
<arcgis-map
item-id="02b37471d5d84cacbebcccd785460e94"
onarcgisViewReadyChange={handleViewReady}
style={{ width: "100%", height: "100%" }}
>
<arcgis-zoom position="top-left" />
<arcgis-search position="top-right" />
<arcgis-legend position="bottom-left" />
</arcgis-map>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment