Select to view content in your preferred language

Show in another color new features on layer

754
4
05-12-2017 10:37 AM
EvelynHernandez
Frequent Contributor

Hello, i want to know if there is a way to show (in another color) new features on a layer that is being updated.

So far i have found in the API for JS a event in the Dynamic and Feature Layer

myDynamicMapServiceLayer.on("update-start",(us)=>{
 console.log("is refreshing to show me updates?",us);
});

For example, once i have been added the feature layer or dynamic service (in my case is a dynamic one) i want to put all the features that im showing in a certain color (lets say blue and they are 100 at the beginning).
Afterwards, i want to put a glow on the one that are new in the place where they appear. Or have them as a data in a new table.

Is there a way to do that?


0 Kudos
4 Replies
SteveCole
Honored Contributor

I have no code to share but, thinking aloud, how about using a renderer based on OBJECTID values? When you start an edit session, determine what the maximum OBJECTID is at the time you start editing and assign it to a variable (call it curMaxOID). Once the edit sesssion is over, create a renderer where OBJECTIDs <= curMaxOID is symbolized using one color and OBJECTID > curMaxOID uses another color.

This might not be a great solution for a layer with a lot of features, though.

Steve

0 Kudos
EvelynHernandez
Frequent Contributor

Well its like the objectid for that layer is not secuential. I was thinking about on save the prev state of the features that i have and then each time when the update-start on the layer see the differences between the old state and the new one.

0 Kudos
KenBuja
MVP Esteemed Contributor

Another solution would be to add those new features to a separate graphic layer and symbolize them differently.

0 Kudos
EvelynHernandez
Frequent Contributor

Actually thinking in a not code based solution. I can just simply add a timing on the layer showing a diff kind of symbol when the feature is just added , and then change it again when the feature completes 1 min.

0 Kudos