Trying to keep two layers in sync

1593
1
Jump to solution
09-11-2013 10:05 AM
Labels (1)
RyanCoodey
Occasional Contributor III
So we have a line feature class (pipelines) that is served up with a pretty elaborate hierarchy filtering on a few different columns a bunch of different ways. We also then have a point feature class of a number of items that exist along these lines (valves for example), the users would like to turn on and off these points independently of the lines (i.e. see just the pipes and no valves), but the points should never show if the corresponding lines are turned off (based off the hierarchy).

We don???t like the idea of duplicating the point layers over and over in each of the lines hierarchy, so currently the points and lines are two separate services. The question I have is what, if any, is a good way to keep the points definition in sync with the lines? The only common link between the two is an ID field.

On a legend changed event it seems we will have to request these IDs from the server passing along the visible lines and then set those in the points LayerDefinition (Yikes that could be a lot of IDs).

Problems using Find:
   - Find requires search text
   - Find doesn???t have option for out fields, so will return much more attributes than just the needed IDs.

Problems using Identify (would just pass a large geometry covering the entire AOI):
   - Like with find, identify doesn???t have option for out fields so sends a lot more than what is needed.

Problems using Query:
   - Does not work on service directly but on individual layers so would require many server requests since the hierarchy is pretty big.

Any ideas or recommendations on how to tackle this? Maybe a better way to design it even?

Thanks a lot for any help or ideas!
0 Kudos
1 Solution

Accepted Solutions
RyanCoodey
Occasional Contributor III
Ended up working this out a little different way... added the columns that are being filtered in the line FC to those of the point FC (was nice to have them there for other reasons too). When the app loads if fetches all the line layers where clauses and then when the legend changes it dynamically scans all the visible sub layers and ORs together all their definition expressions. Then it places the expression on the point service. Works pretty good.

I placed a little sync icon next to the point layers that get dynamically filtered to let users know, and wish each ArcGISDynamicMapServiceLayer had a refresh complete event or something to make them spin while loading. I hooked the icon to the Map.Progress event which is close enough, but would be a nice enhancement for the service layers themselves (like FeatureLayer has).

Still would be curious if anyone has any better ideas... thanks!

View solution in original post

0 Kudos
1 Reply
RyanCoodey
Occasional Contributor III
Ended up working this out a little different way... added the columns that are being filtered in the line FC to those of the point FC (was nice to have them there for other reasons too). When the app loads if fetches all the line layers where clauses and then when the legend changes it dynamically scans all the visible sub layers and ORs together all their definition expressions. Then it places the expression on the point service. Works pretty good.

I placed a little sync icon next to the point layers that get dynamically filtered to let users know, and wish each ArcGISDynamicMapServiceLayer had a refresh complete event or something to make them spin while loading. I hooked the icon to the Map.Progress event which is close enough, but would be a nice enhancement for the service layers themselves (like FeatureLayer has).

Still would be curious if anyone has any better ideas... thanks!
0 Kudos