xmlns:esri="http://schemas.esri.com/arcgis/client/2009"> <Grid x:Name="LayoutRoot" Background="White"> <esri:Map x:Name="MyMap" WrapAround="True" Background="White"> <esri:ArcGISTiledMapServiceLayer ID="PhysicalTiledLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" /> <esri:GraphicsLayer ID="MyGraphics"> <esri:GraphicsLayer.Graphics> <esri:Graphic> <esri:Graphic.Symbol> <esri:TextSymbol FontFamily="Arial" FontSize="14" Foreground="Black" Text="My Text" /> </esri:Graphic.Symbol> <esri:MapPoint X="-10.609" Y="23.729"> <esri:Geometry.SpatialReference> <esri:SpatialReference WKID="4326" /> </esri:Geometry.SpatialReference> </esri:MapPoint> </esri:Graphic> </esri:GraphicsLayer.Graphics> </esri:GraphicsLayer> </esri:Map> <Button Content="Print" VerticalAlignment="Top" HorizontalAlignment="Center" Click="Print_Click" /> </Grid>
private void Print_Click(object sender, RoutedEventArgs e) { var printTask = new PrintTask("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export Web Map Task"); printTask.ExecuteCompleted += (a, b) => { if (b.Error == null) System.Windows.Browser.HtmlPage.Window.Navigate(b.PrintResult.Url, "_blank"); }; printTask.ExecuteAsync(new PrintParameters(MyMap)); }
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.