How to plot a marker point in esri arcgis map using react js

Viewed 433

I am trying to add a point/line in the ArcGIS map using react JS. Now my map is working fine. I'm referring to the https://github.com/odoe/jsapi-react link. But they are using ArcGIS API for JavaScript for adding points on the map with Graphic and GraphicsLayer. I've followed this method for displaying the map https://www.esri.com/about/newsroom/arcuser/react-arcgis/ I'm trying to add Graphic and GraphicsLayer module for adding points on the map. Could anyone help me with how to add Graphic and GraphicsLayer also how to add point or Line on this map. Here is what my app.js code looks like...

import WebMap from "esri/WebMap";
import MapView from "esri/views/MapView";
import Search from "esri/widgets/Search";
import FeatureLayer from "esri/layers/FeatureLayer";

const noop = () => {};

export const webmap = new WebMap({
  portalItem: {
    id: "974c6641665a42bf8a57da08e607bb6f"
  }
});

export const view = new MapView({
  map: webmap
});

export const search = new Search({ view });
view.ui.add(search, "top-right");

export const initialize = (container) => {
  view.container = container;
  view
    .when()
    .then(_ => {
      console.log("Map and View are ready");
    })
    .catch(noop);
  return () => {
    view.container = null;
  };
};

Thank you.

1 Answers
Related