Select to view content in your preferred language

Multiple Query Developer Sample to WAB Widget?

2797
4
Jump to solution
10-20-2015 10:28 AM
DanielStoelb
Frequent Contributor

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.

0 Kudos
1 Solution

Accepted Solutions
DanielStoelb
Frequent Contributor

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.

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

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"

0 Kudos
DanielStoelb
Frequent Contributor

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".

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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"

0 Kudos
DanielStoelb
Frequent Contributor

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.

0 Kudos