<esri:ArcGISDynamicMapServiceLayer ID="Tax Lots" Url="http://someurl/ArcGIS/rest/services/Secure/taxlots/MapServer" ProxyURL="../../../SilverlightProxy/proxy.ashx" VisibleLayers="0" Opacity="1.0" />
if (myLayer.ID == "Tax Lots" ) { myLayer.Visible = false; }
private void ExportMap_Click(object sender, RoutedEventArgs e) { if (printTask == null || printTask.IsBusy) return; busyIndicator.Visibility = Visibility.Visible; // Define the LegendOptions. This will show specified Layers in the printed map's legend area. LegendOptions myLegendOptions = new LegendOptions(); // Define a List<LegendLayer> objects to put in the LegendOptions. List<LegendLayer> myLegendLayers = new List<LegendLayer>(); // Loop through all of the Layers in the Map Control. foreach (var myLayer in MyMap.Layers) { // Create a new LegendLayer object to put in the List<LegendLayer> collection. LegendLayer myLegendLayer = new LegendLayer(); // Set the LegendLayer.LayerId to the Layer.ID to add it to the printed map's legend area. myLegendLayer.LayerId = myLayer.ID; if (myLayer.ID == "Water Rights" || myLayer.ID == "OWRD Layers") { // Add a single LegendLayer into the List<LegendLayer> collection. myLegendLayers.Add(myLegendLayer); } if (myLayer.ID == "Tax Lots" ) { myLayer.Visible = false; } } // Set the LegendOptions.LegendLayer to the new constructed List<LegendLayer> objects. myLegendOptions.LegendLayers = myLegendLayers; PrintParameters printParameters = new PrintParameters(MyMap) { LayoutOptions = new LayoutOptions() { Title=MapTitle.Text, LegendOptions = myLegendOptions}, ExportOptions = new ExportOptions() { Dpi = 96, OutputSize = new Size(MyMap.ActualWidth, MyMap.ActualHeight) }, LayoutTemplate = (string)LayoutTemplates.SelectedItem ?? string.Empty, Format = (string)Formats.SelectedItem, }; printTask.ExecuteAsync(printParameters); }
ProxyURL="../../../SilverlightProxy/proxy.ashx"
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.