Hi, I'm working on a tool that makes a query to a layer an then I zoom to the results with the Map.zoomTo() method sending the envelope of the geometry(s) as a parameter, the problem is that since the Layer is scale dependant sometimes the zoomTo takes me to a extent where the featureLayer is not visible. I would like to find a way to determine if the FeatureLayer will be visible when I zoom the map to that extent and if not zoom until the featureLayer is visible.
I'm using a tiled map service as a base map by the way.
Does anybody have some Ideas on how to acomplish this?
In my experience, feature layer's Visible property always returns true, regardless of the current state of the layer.
In my opinion, you might want to use MaximumResolution and MinimumResolution properties on the feature layer class. Based on current map scale/resolution, you should be able to determine the state of the feature layer.
I tryed that, but those fields are from 0 to inifinit, as there where no scale dependency set, as a workaround I have set the featurelayer to omit scale dependency, but thats not what I want
I tryed that, but those fields are from 0 to inifinit, as there where no scale dependency set, as a workaround I have set the featurelayer to omit scale dependency, but thats not what I want
If IgnoreServoceScaleRange is false, the layer honors both scale ranges, the scale range defined at client side (by Layer.MinimumResolution and Layer.MaximumResolution) and the scale range defined at server side. The latter scale range is defined by the MinimumScale and MaximumScale of FeatureLayer.LayerInfo. I guess in your case you have to use these values.