Skip to content

Commit

Permalink
feat: add coordinates widget (bottom-left)
Browse files Browse the repository at this point in the history
Closes #699
  • Loading branch information
stdavis committed Nov 26, 2024
1 parent ae212ff commit 7c280a9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import Spinner from '../utah-design-system/Spinner';
import Graphic from '@arcgis/core/Graphic';
import { getDefQueryFromLayerFilterValues } from '../utils';
import { fromJSON } from '@arcgis/core/geometry/support/jsonUtils';
import CoordinateConversion from '@arcgis/core/widgets/CoordinateConversion';

const stateOfUtahPolygon = new Polygon(stateOfUtah);
const stateOfUtahExtent = stateOfUtahPolygon.extent;
Expand Down Expand Up @@ -199,6 +200,17 @@ export default function MapComponent() {

view.current.ui.add(legend, 'top-right');

const coordinatesExpand = new Expand({
expandIcon: 'object-detection',
view: view.current,
content: new CoordinateConversion({
view: view.current,
}),
label: 'Coordinates',
});

view.current.ui.add(coordinatesExpand, 'bottom-left');

view.current.on('click', (event) => {
view.current.hitTest(event).then(({ results }) => {
// look for hit on search layer
Expand Down

0 comments on commit 7c280a9

Please sign in to comment.