JSAPI 4.0 released May 3, 2016

3656
12
05-03-2016 10:14 AM
BjornSvensson
Esri Regular Contributor

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

12 Replies
SteveCole
Frequent Contributor

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?

BjornSvensson
Esri Regular Contributor

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?

0 Kudos
TyroneBiggums
Occasional Contributor III

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().

BjornSvensson
Esri Regular Contributor

Tyrone Biggums​ - if you reset the renderer on the layer, the redraw() is not needed in 4.x.

0 Kudos
SteveCole
Frequent Contributor

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.

0 Kudos
KristianEkenes
Esri Regular Contributor

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.

0 Kudos
DavidColey
Frequent Contributor

Hi Bjorn - I'm assuming the available widgets will increase as they are migrated?  In particular, Directions, Print, Basemap Gallery, LayerList?

Thanks

David

0 Kudos
BjornSvensson
Esri Regular Contributor
0 Kudos
DavidColey
Frequent Contributor

Oh there it is, thanks Bjorn - don't know how I missed that!

0 Kudos