Presentation is loading. Please wait.

Presentation is loading. Please wait.

ArcGIS API for Silverlight – Advanced Topics

Similar presentations


Presentation on theme: "ArcGIS API for Silverlight – Advanced Topics"— Presentation transcript:

1

2 ArcGIS API for Silverlight – Advanced Topics
July 25-26, 2012 ArcGIS API for Silverlight – Advanced Topics Rex Hansen Jennifer Nery

3 Agenda Introductions and overview Graphics data sources
ArcGIS Portal API High-Quality Printing Deep dive into image services Editing workflow Dynamic Layers with Query Statistics

4 Graphics Data Sources Jennifer Nery

5 Adding Graphics to GraphicsLayer
foreach(Graphic g in myGraphics) graphicsLayer.Graphics.Add(myGraphics); or graphicsLayer.GraphicsSource = myGraphics; read-only when GraphicsSource is used! can by any IEnumerable<Graphic>

6 Adding Custom Data to a GraphicsLayer
public class MyData { public double Longitude { get; set; } public double Latitude { get; set; } } foreach(MyData in dataList) myGraphicsLayer.Graphics.Add( new Graphic() { new MapPoint(Longitude, Latitude) );

7 …Simpler with PointDataSource
<esri:GraphicsLayer> <esri:GraphicsLayer.GraphicsSource> <esri:PointDataSource XCoordinateBinding="{Binding Longitude}" YCoordinateBinding="{Binding Latitude}" ItemsSource="{StaticResource dataList}" /> </esri:GraphicsLayer.GraphicsSource> </esri:GraphicsLayer>

8 ArcGIS Portal API Jennifer Nery

9 using ESRI.ArcGIS.Client.Portal
var portal = new ArcGISPortal(“ var parameters = new SearchParameters { QueryString = query.Text, Limit = 5 }; portal.SearchItemsAsync(parameters, (result, error) => { if(error == null) Results.ItemsSource = result.Results; };

10 <ListBox x:Name=“Results”> <ListBox
<ListBox x:Name=“Results”> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text=“{Binding Title}”/> <TextBlock Text=“{Binding Owner}”/> <Image Source=“{Binding ThumbnailUri}”/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>

11 …with IdentityManager
IdentityManager.Current.RegisterServers( new ServerInfo[ ] { new ServerInfo() { ServerURL = “ TokenServiceURL = “ } }); IdentityManager.Current.ChallengeMethod = Challenge;

12 Sign in IdentityManager.Current.GenerateCredentialAsync( “ username, password, (credential, error) => { if(error == null) { IdentityManager.AddCredential(credential); Portal.InitializeAsync(“ (crd, ex) => {…} ) ; } } );

13 Sign out var credential = IdentityManager.Current.FindCredential( “ username); IdentityManager.Current.RemoveCredential(credential ); portal.InitializeAsync(“ (crd, ex) => {…});

14 High-Quality Printing
Jennifer Nery

15 using ESRI.ArcGIS.Client.Printing
var printTask = new PrintTask(“ printTask.ExecuteCompleted += (s, e) => { if (e.Error == null) HtmlPage.Window.Navigate(e.PrintResult.Url, “_blank”); }; printTask.ExecuteAsync(new PrintParameters(MyMap)); or printTask.StatusUpdated += (s, e) => {…}; printTask.JobCompleted += (s, e) => {…}; printTask.SubmitJob(…);

16 <StackPanel x:Name=“PrintPanel”> <ComboBox x:Name=“Templates” ItemsSource=“{Binding LayoutTemplates}”/> <ComboBox x:Name=“Formats” ItemsSource=“{Binding Formats}”/> <TextBox x:Name=“MapTitle” Text=“Print Demo”/> </StackPanel> printTask.GetServiceInfoCompleted += (s, e) => { PrintPanel.DataContext = e.ServiceInfo; }; printTask.GetServiceInfoAsync();

17 var printParams= new PrintParameters(MyMap); printParams
var printParams= new PrintParameters(MyMap); printParams.LayoutTemplate = (string) Templates.SelectedItem; printParams.Format = (string) Formats.SelectedItem; printParams.LayoutOptions = new LayoutOptions() { Title = MapTitle.Text, LegendOptions = new LegendOptions() {…}, ScaleBarOptions = new ScaleBarOptions() {…}, … }; printParams.MapOptions = new MapOptions() {…}; printParams.ExportOptions = new ExportOptions() {…} printTask.ExecuteAsync(printParams);

18 PrintTask: Known Limitations in v3.0
Custom symbols/renderers Clustering KmlLayer does not support visibleFolders GraphicsLayer with mixed geometries FeatureLayer selection/geometry require ObjectID

19 Related Session Supporting High-Quality Printing in Web Applications with ArcGIS 10.1 Server Thursday, July 26, 2012 8:30 AM – 9:45 AM Room 07 A/B

20 Diving into Image Services
Rex Hansen

21 Image Server Editing Add, update and delete rasters in a mosaic dataset public class ArcGISImageServiceLayer : Layer { AddRasters( ImageServiceAddParameters, Action<ImageServiceEditResults, Exception>) UpdateRaster( ImageServiceUpdateParameters, Action<ImageServiceEditResults, Exception>) DeleteRasters( IEnumerable<int>, Action<ImageServiceEditResults, Exception>) }

22 Upload Task Great for upload of large files
Provides progress, cancellation and deletion Great for large geoprocessing input or raster uploads

23 Mensuration Task New task for measuring length, height, area etc. based on imagery data public class MensurationTask : TaskBase { Point ( … ) DistanceAndAngle ( … ) HeightFromBaseToTop ( … ) HeightFromBaseAndTopShadow ( … ) HeightFromTopAndTopShadow ( … ) AreaAndPerimeter ( … ) Centroid ( … ) }

24 Raster Functions Common and custom functions to change how a raster is rendered RasterFuctionsComboBox.ItemsSource = imgLayer.RasterFunctionInfos; var rasterFunction = RasterFuctionsComboBox.SelectedItem as RasterFunctionInfo; RenderingRule renderingRule = new RenderingRule() { RasterFunctionName = rasterFunction.Name }; imgLayer.RenderingRule = renderingRule; imgLayer.Refresh();

25 Editing Workflow Rex Hansen

26 Editor Tracking Feature last edited by another user
Feature moved, last edited user and date updated

27 Ownership Can’t update or delete, don’t own the feature
Created feature, can update and delete

28 Attribute-only editing
Feature is not allowed for delete or geometry edit.

29 Feature Service – Editor Tracking
FeatureLayer.EditUserName Client side validation FeatureLayer.IsUpdateAllowed(graphic) Check if feature can be updated FeatureLayer.IsGeometryUpdateAllowed(graphic) Check if feature’s geometry can be updated FeatureLayerInfo.EditFieldsInfo Owner, editor, date FeatureLayerInfo.OwnershipBasedAccessControl If others can update, delete FeatureLayerInfo.AllowGeometryUpdates Attribute only editing

30 Dynamic Layers with Query Statistics
Rex Hansen

31 Change the renderers LayerDrawingOptions:
Allows you to override the renderer for each layer. Use GenerateRendererTask helper to create good class breaks. DynamicLayerInfos: Reorder the layers Change the source data Map layers, workspaces, tables, joins…

32 DynamicLayerInfos LayerMapSource LayerDataSource:
reference layers already in map service LayerDataSource: TableDataSource (workspaces & GDB versions) QueryDataSource (query layers) RasterDataSource (raster data) JoinDataSource (join the above sources) Note: When you use DynamicLayerInfos, you replace all existing layer infos.

33 QueryTask - Statistics
Sum, Average, Min, Max, Count, Standard Deviation, Variance var query = new Query() { GroupByFieldsForStatistics = new List<string> { "SUB_REGION" }, OutStatistics = new List<OutStatistic> { new OutStatistic() { OnStatisticField = "POP2000", OutStatisticFieldName = "SubRegionPopulation", StatisticType = StatisticType.Sum . . .

34 Thank you for attending
Have fun at UC2012 Open for Questions Please fill out the evaluation: First Offering ID: 787 Second Offering ID: 1936

35


Download ppt "ArcGIS API for Silverlight – Advanced Topics"

Similar presentations


Ads by Google