I don't want the features to draw when I zoom out beyond the Min Scale.
public MainPage() { InitializeComponent(); FeatureLayer layer = this.MyMap.Layers["LayerID"] as FeatureLayer; if (layer == null) return; WebClient webClient = new WebClient(); webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted); webClient.DownloadStringAsync(new Uri(layer.Url + "?f=json", UriKind.RelativeOrAbsolute)); } void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { string[] properties = e.Result.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); string minScale = properties.FirstOrDefault(p => p.Contains("minScale")); if(minScale != null) minScale = minScale.Substring(minScale.IndexOf(':') + 1, minScale.Length - (minScale.IndexOf(':') +1)); //TODO: use this minScale value. }
Why would you need to set the MinimumScale?
You can do a call to DownloadStringAsync from WebClient, with Uri = layer's url appended with "?f=json". In the DownloadStringCompleted eventhandler, you can parse the result to get MinimumScale property.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.