Select to view content in your preferred language

The feature layer graphic dose not get updated

209
2
Jump to solution
3 weeks ago
Labels (3)
JohnZachariassen
Occasional Contributor

Hey,

I have a FeatureLayer in my map, and it displays polygons. I'm using the ArcGIS Maps SDK for JavaScript  to display the map. However, when I change the shape of a polygon in ArcGIS Pro, the shape gets updated in the service, but it doesn't reflect in the map, unless I clear the browser cache.

Is there a way to force the feature layer to refresh and display the updated geometry in the map without clearing the cache?

0 Kudos
1 Solution

Accepted Solutions
JoelBennett
MVP Regular Contributor

Technically yes, but it's not pretty.  Despite the workflow being different, the basic problem and its solution are described in this thread.  In your workflow, you just want the layer to draw the changes.  What makes these similar is that the layer is doing the same kind of query operation seen in that thread in order to retrieve the data and draw it on the map.  The only way I know of to alter this workflow and insert a where clause is to use a RequestInterceptor.  A recent thread involving the use of those is here.

View solution in original post

2 Replies
JoelBennett
MVP Regular Contributor

Technically yes, but it's not pretty.  Despite the workflow being different, the basic problem and its solution are described in this thread.  In your workflow, you just want the layer to draw the changes.  What makes these similar is that the layer is doing the same kind of query operation seen in that thread in order to retrieve the data and draw it on the map.  The only way I know of to alter this workflow and insert a where clause is to use a RequestInterceptor.  A recent thread involving the use of those is here.

JohnZachariassen
Occasional Contributor

The query was altered to include an equal statement: current_rnd = current_rnd, where current_rnd is a new random number everytime the query is created. And it works 😊