I'm working on converting the JS API Sample (Manage results from multiple queries | ArcGIS API for JavaScript ) to a WAB widget and I'm running into an issue indicating that the "ReferenceError: 'graphics' is undefined ReferenceError: 'graphics' is undefined". I've attached the code that I have to this message (some of the url's to the queries are removed to protect some of the data). Is there something that I'm doing wrong in the coding for this to make it work? It is looking like the queries are running, but none of the results are shown in the map.
Any help would be appreciated. Thanks.
Solved! Go to Solution.
I was able to resolve the issue by using a "map=this.map" at the start and changing the graphics to "map.graphics.add()" and that worked.
Daniel,
I don't see in your code where you define what "graphics" is. In the sample they use "app.map.graphics" so in your case it should be "this.map.graphics"
So when changing the code to state "this.map.graphics", it is coming up with an error indicating "TypeError: Unable to get property 'add' of undefined or null reference TypeError: Unable to get property 'add' of undefined or null reference".
Daniel,
If you look at the docs map.graphics gets you the graphicsLayer for the map if you want to add to the graphicsLayer then you need "this.map.graphics.graphics.add"
I was able to resolve the issue by using a "map=this.map" at the start and changing the graphics to "map.graphics.add()" and that worked.