Select to view content in your preferred language

[esri.core.Accessor] Accessor#set Assigning an instance of 'esri.Graphic' which is not a subclass of 'esri.Graphic'

621
0
10-26-2022 07:30 AM
NorbertByiringiro
Emerging Contributor

 Hello folks,

I am adding graphs on a view, and they are being added well, but the console keeps showing me the error:

[esri.core.Accessor] Accessor#set Assigning an instance of 'esri.Graphic' which is not a subclass of 'esri.Graphic'

Below is the code:

 

 

import Graphic from "@arcgis/core/Graphic";
import Point from "@arcgis/core/geometry/Point";
 

//{map and view  options defined in another component}
function PathDraw( view, myPath) {
   const polyline = {
      type: "polyline",
      paths: myPath,
    };
 
 const lineSymbol= {
    type: "line-3d", 
    symbolLayers: [
      {
        type: "line", 
        material: { color: "orange" },
        size: "2px",
        },
      },
    ],
  };
 
 const polylineGraph= new Graphic({
      geometry: polyline,
      symbol: lineSymbol,
    });
 
 view.graphics.add(polylineGraph);

}
 export default PathDraw
​

 

 
 
NorbertByiringiro_0-1666794023032.png

 Does anyone has an idea about this? Thanks

0 Kudos
0 Replies