Hi,
I am wondering if it is possible to create a definition expression on a feature layer that was created from a feature collection (or JSON). I have modeled part of my application after this sample on for version 4x:
ArcGIS API for JavaScript Sandbox
After setting the definition expression and then printing out the feature layer (console.log), I can see in the meta data that a definition expression has been set, but it just doesn't display on the map.
Can anyone provide me with an explanation to this behavior? I have also reproduced the same results in the above sample sandbox.
Thanks,
Jacob
Solved! Go to Solution.
From the FeatureLayer documentation
Known Limitations
Definition expressions will not be honored when working with FeatureLayers created from client-side graphics.
From the FeatureLayer documentation
Known Limitations
Definition expressions will not be honored when working with FeatureLayers created from client-side graphics.
Hi Ken,
Thank you for your speedy response, although it is unfortunate that this is not supported.
Just a little bit more information for my reason for using client side graphics:
I am currently developing a SaaS based application that utilizes one primary feature class. I am returning the client side graphics via the REST API with C# which allows me to only return the logged in user's content.
To your knowledge, is there another way of going about this without the use of client side graphics as well as not exposing the user's information, such as their userid?
Thank,
Jacob
Unfortunately, I don't have a solution. You should probably ask this as a separate question to get a wider response (and mark this one as answered).
One solution I can think of is to loop through the graphics when you get them returned and set the ones that are not suppose to be visible to invisible by setting the visible property on the graphic.
it works now