I have map where I am zooming to a parcel. The parcel layer is part of a service so I load all the layers in the service as a ArcGISDynamicMapServiceLayer layer. I also load a point feature from another service as a FeatureLayer. When I zoom to a parcel, I then want to zoom out until I can see at least one feature from the FeatureLayer. Is this possible, and if so can anyone give me guidance as to how to easily accomplish this? Any help would be greatly appreciated.
Priscilla,
Are you saying that you need to determine (in the code) how far to zoom out until you have at least one of the other features in your maps extent?
Yes Robert. That's exactly what I'm saying. When some enters a parcel key I zoom to it. But really what I want to do is set the extent so that the nearest point to that parcel polygon, along with the polygon itself, is displayed.
Priscilla,
OK that would involve zooming to the parcel and then doing a spatial query to see if a feature from the other layer intersects the maps extent and if not zoom out again and repeat the process until you get a successful result of the intersects query. Is the other feature part of the same map service or is it possibly added as a FeatureLayer?
The other feature is not part of the same map service but is added as a featurelayer. I had also thought about doing a spatial query with a buffer but then I found something about FindNearest which uses the spatial analyst service. However, I don't want to use ESRI's spatial analyst service. I want to build my own but I'm not sure how to do that.
Priscilla,
Does the app or the data happen to be public?