The ArcGIS API for JavaScript version 4.0 was released today. See the blog for a good overview, then head over to the developers site for details
featureLayer.redraw() was removed and ESRI has no plans to add it to v4.0. What's ESRI's recommendation if you need this functionality moving forward?
Steve Cole - the goal is that the FeatureLayer should be smart enough to redraw when needed. Could you explain in more detail your use cases for when you think the old redraw() functionality would still be needed in 4.x?
I'd like to step in with my use case since I'm wondering the same thing.
We have a FL drawn on the map. The user has the option to view the symbols in that FL (in a list box). The user has the ability to select a symbol, from a list, within a FL and select a new symbol. When the user selects a new symbol and submits, the FL is updated.
In 3.x, the way we accomplish this is with layer.redraw().
Tyrone Biggums - if you reset the renderer on the layer, the redraw() is not needed in 4.x.
Bjorn Svensson The first use I found in my apps is much like Tyrone's. I have an app where the users can alter the default symbology for a feature layer (fill color, outline color & thickness) and the redraw method is called after the user has made their alterations.
I have another application that has a feature layer that is created client side and updated with new content from a service every 10 minutes. This is done by applying a new feature collection to the layer. After the feature collection is updated (layer.applyEdits), I call redraw. Maybe in this case, redraw isn't needed; I dunno.
As Bjorn stated in the preceding comment, redraw() will not be needed. The redraw will be handled for you in both scenarios. Once you set a new renderer on a layer (layer.renderer = yourNewRenderer) the redraw will automatically happen. Same thing with the client side graphics.
Hi Bjorn - I'm assuming the available widgets will increase as they are migrated? In particular, Directions, Print, Basemap Gallery, LayerList?
Thanks
David
David Coley - Yes, see "Functionality matrix | ArcGIS API for JavaScript 4.0" for more details.
Oh there it is, thanks Bjorn - don't know how I missed that!