Hi,
The points are not getting plotted even though the data is coming form the calling API. I am trying to plot the points based on the latitude and longitude coming via an API. I can see the data in the console but its not getting plotted while calling this function.
PFB the code snippet:
const getpoints = () => {
view.graphics.removeAll();
, ).subscribe({
next: (data) => {
console.log('data of lat long is ', data);
data.forEach((result: any) => {
console.log('my result is', result);
const latlongpoint = {
// Create a point
type: 'point',
longitude: result.lng,
latitude: result.lat,
};
console.log('what is my latlongpoint', latlongpoint);
locationlist.push(latlongpoint);
addGraphic('cross', latlongpoint);
});
},
error: (error) => {
console.error('There was an error while fetcing latitude and longitude data', error);
return error;
},
});
};
view.on('click', getpoints);