Select to view content in your preferred language

Receiving an error when setting an array of graphics to a graphics layer

775
4
01-02-2018 02:14 PM
MikeDominado1
New Contributor

Hello,

I would like some assistance regarding to the the 4.4 API that you guys have. My current issue right now is that I am receiving an error from the API's code when I try to set an array of graphics to an already initialized graphics layer.

More specifically, this is the error I am getting: 

Just for clarification the length of the array that I am setting to the graphics layer is about 88000, however, I am expecting to test against data larger than that. I can't do that though if I am running into this error when testing against this much data.

So, I was wondering if someone had any resolution to this issue? Any help would be appreciated.

Regards,

Mike

0 Kudos
4 Replies
EvelynHernandez
Regular Contributor

I think u are doing something wrong on handling the array of graphics that made the computer's memory hits the call stack limit so the browser hardcoded stack size or memory exhaustion.

0 Kudos
MikeDominado1
New Contributor

Evelyn,

That does make sense somewhat, but this error happens after I

1. Process geometries from an arcgis rest api call

2. Use those returned geometries to make an array of graphics

3. And then set that array of graphics to the graphics layer.

Also, I am not getting this error when the array length is not so huge.

0 Kudos
MikeDominado1
New Contributor

Evelyn,

Would you mind taking a look at my code to see what I did wrong?

Here are the steps I am taking to initialize the array of graphics to the graphics layer.

1. Process geometries from an arcgis rest api call


2. Use those returned geometries to make an array of graphics

3. And then set that array of graphics to the graphics layer

In this last section just to be clear, I am using the shapesAllSymbol array (array of geometries that I processed into graphics) and pushed each graphics into the allGraphics array and then set the allGraphics array to the graphics layer that is already initialized.

Thanks

0 Kudos
EvelynHernandez
Regular Contributor

Let me see if i understood. U are getting a data response that contains features from ur rest service?. In that case, why u are making a new array to pass it to the graphicslayer?

and also, which one is the purpose to use a graphicslayer? 
If u wanna show data, make a ur desired query with something to filter the results (like definitionExpression or so).

Im not too familiar with the new api 4.x, but i have done a lot of complex queries on rest services with a lot of data, so to me its kinda weird that u have the "stack" problem with a variable.

0 Kudos