AnsweredAssumed Answered

Equivalent of "Select Features" and "Map Graphics" in Javascript 4

Question asked by Eletrosul on May 3, 2017
Latest reply on May 24, 2018 by rscheitlin

I'm trying to migrate a webapp that was under development in the 3.7 API to use the 4.3 API


The base functionality of the app was that when the user would hold CTRL to click a point feature, it would make a SELECTION_ADD, selecting multiple features.


Also another functionality I can't find is changing the renderer/color of specific features, before I would go into the map graphics and change them directly (although I've found that wasn't the best way), now I'm not sure anymore


Everything gets even harder because I'm not working with FeatureLayer anymore, but instead a WebMap (which is a MapImageLayer)


In the end, my questions sum up to:


1) How to "select features" in a MapImageLayer/SubLayer, or any equivalent to getting the OBJECTID of a clicked feature.


2) How to change the renderer/color of specific features only, in this case would be the clicked features, but there is another case that is through a list of OBJECTIDs, (I believe this could be done by adding graphics on top of the features too, that would be no problem since my app is only for display purposes)


In 3.7 I used the layers events "click" and "selection-complete" to handle the logic, are these events no longer part of the flow of 4.X apps?


Any help as to where start or links to examples would be appreciated.