Bug: InfoWindow removes graphic

3766
4
Jump to solution
04-07-2015 02:13 PM
JeffJacobson
Occasional Contributor III

I am having an issue where clicking on a graphic in a feature layer more than once will remove the graphic. I have created a plunk that demonstrates this issue. Note that the issue only occurs when using the arcgisUtils.createMap function, not when using the Map constructor.

Is there anything I can do to prevent the graphics from being removed, is this a bug that I need to wait for Esri to fix?

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Instead of using the GraphicsLayer add method to add the graphic to the layer try using the feature layer applyEdits method. For example:

 

    fLayer.applyEdits([graphic]);

View solution in original post

4 Replies
KellyHutchins
Esri Frequent Contributor

Instead of using the GraphicsLayer add method to add the graphic to the layer try using the feature layer applyEdits method. For example:

 

    fLayer.applyEdits([graphic]);

JeffJacobson
Occasional Contributor III

Thanks Kelly Hutchins, that fixed the issue I was having.

Is the "bug" I was experiencing actually a bug, though? I didn't see anything in the documentation telling me not to use the add function, and add works when creating the map via the Map constructor. I still don't understand why the graphic was disappearing.

0 Kudos
KellyHutchins
Esri Frequent Contributor

Jeff Jacobson​ this one could be a documentation bug or a bug with the api.  Can you submit this as a support incident so we can track this issue and determine how to resolve the bug.

KellyHutchins
Esri Frequent Contributor

Looks like this a a documentation bug. Using add with FeatureLayer isn't supported. We'll get the documentation updated to state this.

Kelly

0 Kudos