API Reference Error

525
3
01-27-2014 08:34 PM
BenFousek
Occasional Contributor III
Happened to be looking at esri/graphic and noticed that on 'graphic-add' says it returns the graphic object, when it returns an object consisting of the graphic and target (the layer).

I know you guys have a lot going on, but keeping the reference up-to-date and correct seems critical. Since the switch to AMD, I don't trust the reference for event returns and just test returns myself in console when I work with new events. This isn't the only one that didn't get updated during the 'on' switch.

As always, thanks for your consideration.
0 Kudos
3 Replies
JonathanUihlein
Esri Regular Contributor
Hi Ben,

Can you post a link to the specific documentation page that you are talking about?
(Is it this: https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#event-graphic-add ?)

I assume you meant the 'graphic-add' event for FeatureLayer, which returns both the 'graphic' and 'target' inside a single object, as you stated.

In this case, the documentation is incorrect and I've opened a ticket to get it fixed.

Thanks!

*edit

I noticed this snippet on the page I linked:

"All On Style event listeners receive a single event object. The event  properties listed below are accessed from this event object.  Additionally, the event object also contains a 'target' property whose  value is the object which fired the event."

It looks like this is intended.
0 Kudos
BenFousek
Occasional Contributor III
Thanks Jon,
I missed that part. I guess when I look at the return I expect to see everything I'm getting.

Here's another for you. https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#queryfeatures In the sample it shows "esri/tasks/Query" instead of esri/tasks/query".
0 Kudos
JonathanUihlein
Esri Regular Contributor
Great find Ben!
Thanks a bunch for pointing that out.
I'll notify the doc guys and get it fixed.

If you ever find any other issues don't hesitate to email the team, email support or make a new thread here. You're always very helpful.

Thanks again Ben!
0 Kudos