Select to view content in your preferred language

Graphic not showing on map

265
0
10-28-2022 12:20 PM
abdulsaheeddurodola
Emerging Contributor

Hi all,

I am trying to develop a widget for my organization. It would automatically create graphics. I will be using web app builder developer to build this widget

Method:function()
{
    this.graphicsLayer = new GraphicsLayer();
   
   this.map.addLayer(this.graphicsLayer);//graphics layer in Map.graphics

  let des_paths=[
[-79.038452,43.894920],
 
[-79.038452,43.89426],
  ]
 
const polyline = {
type: "polyline",
paths:des_paths
};
const simpleLineSymbol = {
type: "simple-line",
color: "blue", // Orange
width: 100
};

const polylineGraphic = new Graphic({
geometry: polyline,
symbol: simpleLineSymbol
});
console.log(this.graphicsLayer);
this.graphicsLayer.add(polylineGraphic);

/////

const point = { //Create a point
  type: "point",
  longitude: -79.038452,
  latitude: 43.894920
};

const simpleMarkerSymbol = {
  type: "simple-marker",
  color: [226, 119, 40],  // Orange
  outline: {
      color: [255, 255, 255], // White
      width: 1
  }
};
const pointGraphic = new Graphic({
  geometry: point,
  symbol: simpleMarkerSymbol
});

this.graphicsLayer.add(pointGraphic);
 
//
}
I do not see any of the 2 graphics on the map


0 Kudos
0 Replies