I have a map service w/ 2 layers in it both with a min & max scale set. If I add the service as an ArcGISDynamicMapServiceLayer to a map, these scale dependancies are honored even in the Legend control.If I just want to add one of the layers from that MapService as a FeatureLayer to a map, how would I do it using the values that I can see in the MapService Layer? The Layer class has a minResolution and maxResolution but is that the same as scale? partial code snippet of how I create the FeatureLayer -
//mapservice is a class returned from an EntityQuery that pulls service properties from a database
FLayer = new FeatureLayer();
FLayer.Url = mapservice.ServerURL + "/" + mapservice.MapServiceName;
FLayer.Mode = FeatureLayer.QueryMode.OnDemand;
FLayer.Initialized += FLayer_Initialized;
if (mapservice.Proxy)
{
FLayer.ProxyUrl = "../proxy.ashx";
}
layer = FLayer;
....snip...
layer.InitializationFailed += Layer_InitializationFailed;
layer.ID = mapservice.DisplayName;
layer.Opacity = mapservice.Transparency == 0 ? 100 : 1 - (Convert.ToDouble(mapservice.Transparency) / 100);
layer.Visible = mapservice.Active;
MyMap.Layers.Add(layer);
Do I need to get the min/max scales using something like
WebClient Web = new WebClient();
Web.DownloadStringAsynch(Flayer.url + "?f=pjson");
And grab the scale properties from the json layer description?Thanks, Terry