1
+ import '@ugrc/layer-selector/src/LayerSelector.css' ;
2
+ import cityExtents from './data/cityExtents.json' ;
3
+
1
4
import Polygon from '@arcgis/core/geometry/Polygon' ;
5
+ import Graphic from '@arcgis/core/Graphic' ;
2
6
import VectorTileLayer from '@arcgis/core/layers/VectorTileLayer' ;
3
7
import EsriMap from '@arcgis/core/Map' ;
4
8
import MapView from '@arcgis/core/views/MapView' ;
@@ -7,16 +11,13 @@ import { useEffect, useRef, useState } from 'react';
7
11
import { useMap } from './hooks' ;
8
12
import { randomize } from './utils' ;
9
13
10
- import '@ugrc/layer-selector/src/LayerSelector.css' ;
11
- import cityExtents from './data/cityExtents.json' ;
12
-
13
14
const { item : randomExtent } = randomize < Graphic > ( cityExtents ) ;
14
15
const urls = {
15
16
landownership :
16
17
'https://gis.trustlands.utah.gov/hosting/rest/services/Hosted/Land_Ownership_WM_VectorTile/VectorTileServer' ,
17
18
} ;
18
19
19
- export const MapContainer = ( ) => {
20
+ export const MapContainer = ( { onIdentifyClick } : { onIdentifyClick : Function } ) => {
20
21
const mapNode = useRef ( null ) ;
21
22
const mapComponent = useRef ( null ) ;
22
23
const mapView = useRef ( null ) ;
@@ -43,9 +44,9 @@ export const MapContainer = () => {
43
44
44
45
setMapView ( mapView . current ) ;
45
46
46
- // mapView.current.when(() => {
47
- // mapView.current.on('click', onClick );
48
- // });
47
+ mapView . current . when ( ( ) => {
48
+ mapView . current . on ( 'click' , onIdentifyClick ) ;
49
+ } ) ;
49
50
50
51
const selectorOptions = {
51
52
view : mapView . current ,
0 commit comments