0

I'm new to argis, I'm trying to Integrate a Custom API Data with React js FeatureTableBelow is my sample code:
Here in this code I'm using the esri to load the widgets and show the basemap and others this everything working fine i need to fix the table in arcgis.

import { Box } from '@mui/material';
import React, { useEffect } from 'react';
import { loadModules } from 'esri-loader';

export default function Home() {
  useEffect(() => {
    loadModules(['esri/WebMap', 'esri/views/MapView', 'esri/layers/FeatureLayer', 'esri/widgets/FeatureTable'], { css: true })
      .then(([WebMap, MapView, FeatureLayer, FeatureTable]) => {
        let webmap = new WebMap({
          portalItem: {
            id: '' 
          }
        });

        let view = new MapView({
          container: 'viewDiv',
          map: webmap
        });

        view.when(() => {
          const featureLayer = new FeatureLayer({
            portalItem: {
              id: '' //feature layer id
            },
            outFields: ['*'],
            title: 'Customer'
          });

          webmap.add(featureLayer);

          const featureTable = new FeatureTable({
            view: view,
            layer: featureLayer,
            multiSortEnabled: true,
            editingEnabled: true,
            tableTemplate: {
              columnTemplates: [
                // Column template configurations
              ]
            },
            container: 'tableDiv'
          });

          view.ui.add(featureTable, 'bottom');
        });
      })
      .catch(error => {
        console.error('Error loading modules:', error);
      });
  }, []);

  return (
    <Box>
      <Box id='viewDiv' sx={{ flex: '1', width: '100%' }}></Box>
      <Box id='tableDiv' sx={{ flex: '1', width: '100%' }}></Box>
    </Box>
  );
}
2
  • Please narrow down your question to a specific error or issue and the minimal code required to reproduce it: stackoverflow.com/help/minimal-reproducible-example Commented May 16, 2024 at 22:36
  • I need help with two specific requirements for my ArcGIS integration in a React application: Populate Feature Table on Map Click: When a user clicks on the map, I want the Popup data to be displayed in the feature table. Integrate Custom API Data: I need to fetch data from a custom API and display it in the feature table. Commented May 17, 2024 at 5:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.