developing applications with arcgis server using the ...€¦ · developing applications with...

59
Developing Applications with ArcGIS Server Using Developing Applications with ArcGIS Server Using the Microsoft .NET Framework the Microsoft .NET Framework Mark Ho Mark Ho Kevin Deege Kevin Deege

Upload: vukien

Post on 04-Jun-2018

235 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Developing Applications with ArcGIS Server Using Developing Applications with ArcGIS Server Using the Microsoft .NET Frameworkthe Microsoft .NET Framework

Mark HoMark HoKevin DeegeKevin Deege

Page 2: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

AgendaAgenda

•• Introduction to the Web ADFIntroduction to the Web ADF•• Web ControlsWeb Controls•• Extending the Toolbar ControlExtending the Toolbar Control•• Developer APIDeveloper API’’ss•• Web ADF TasksWeb ADF Tasks•• Highlights of 9.3.1Highlights of 9.3.1•• Q & AQ & A

Page 3: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

AuthorAuthor

ServeServe

UseUse

ArcGIS Server

ArcGIS Desktop

ArcGIS Server 9.3ArcGIS Server 9.3Complete and Interoperable ServerComplete and Interoperable Server--Based GISBased GIS

Page 4: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

GIS on the Web in 3 stepsGIS on the Web in 3 steps

Author GIS contentAuthor GIS content–– Create GIS resourcesCreate GIS resources–– ArcGIS Desktop applicationsArcGIS Desktop applicationsPublish contentPublish content–– Publish GIS resources as servicesPublish GIS resources as services–– ArcCatalog and ArcGIS ArcCatalog and ArcGIS

Server ManagerServer ManagerUse GIS servicesUse GIS services–– Web mapping applicationsWeb mapping applications–– ArcGIS ExplorerArcGIS Explorer–– ArcGIS DesktopArcGIS Desktop–– Many othersMany others

Page 5: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

GIS Services are created from GIS ResourcesGIS Services are created from GIS Resources

Service typeService type Published usingPublished using

MapMap Map document (.mxd or .pmf)Map document (.mxd or .pmf)

GlobeGlobe Globe document (.3dd)Globe document (.3dd)

GeocodeGeocode Locator (.loc file or geodatabase)Locator (.loc file or geodatabase)

GeodataGeodata Geodatabase connection (.sde) or Map Geodatabase connection (.sde) or Map document with geodatabase layerdocument with geodatabase layer

GeoprocessingGeoprocessing Toolbox (.tbx) or Map document (.mxd) with Toolbox (.tbx) or Map document (.mxd) with tool layertool layer

ImageImage Raster dataset or layer file (.lyr) or image Raster dataset or layer file (.lyr) or image service file (.iscdef)service file (.iscdef)

Page 6: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

ArcGISArcGISServerServer

Web Map AppWeb Map App

RESTWeb ADF

SilverLight FlexJavaScript

ArcGIS Server Web Development ArcGIS Server Web Development Options for building web clientsOptions for building web clients

Page 7: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF Development 101Web ADF Development 101What do you need to know?What do you need to know?

•• Client and Server side web developmentClient and Server side web development–– ASP.NET (C#, VB.NET)ASP.NET (C#, VB.NET)–– HTML/CSSHTML/CSS–– ASP.NET AJAXASP.NET AJAX

•• Partial PostbacksPartial Postbacks•• JavascriptJavascript•• Application ServicesApplication Services

•• Familiar with IISFamiliar with IIS–– Performance, Scalability, ASP.NET worker processPerformance, Scalability, ASP.NET worker process

Page 8: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

•• Web server (IIS)Web server (IIS)•• Visual Studio .NET Visual Studio .NET

–– 2005/20082005/2008–– .NET Framework.NET Framework–– 2.0/3.0/3.52.0/3.0/3.5

•• ASP.NET AJAX extensionsASP.NET AJAX extensions•• Web Application Development Framework (ADF)Web Application Development Framework (ADF)•• Access to GIS server requiredAccess to GIS server required

–– Local or remoteLocal or remote

Web ADF Development 101Web ADF Development 101Development ConfigurationDevelopment Configuration

Page 9: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

•• Developer SDKDeveloper SDK’’ss•• Sample GIS ServerSample GIS Server•• ArcGIS OnlineArcGIS Online•• Online HelpOnline Help•• CommunityCommunity

–– Blogs & ForumsBlogs & Forums–– Code GalleryCode Gallery

•• SupportSupport–– Knowledge BaseKnowledge Base–– Software updatesSoftware updates

http://resources.esri.comhttp://resources.esri.com

ArcGIS Resource CentersArcGIS Resource CentersDeveloper Help Developer Help

Page 10: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

DEMODEMO

ArcGIS Server Resource CenterArcGIS Server Resource Center

Page 11: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Introducing the Web Application Developer Framework Introducing the Web Application Developer Framework (ADF)(ADF)

•• .NET libraries used to build GIS Web applications.NET libraries used to build GIS Web applications•• Web ADF JavascriptWeb ADF Javascript•• Web controlsWeb controls

–– Mapping, resource management, multiMapping, resource management, multi--sourcesource–– AJAX enabledAJAX enabled

•• Task frameworkTask framework–– Extensible ArchitectureExtensible Architecture

•• Visual Studio integration (2005 and 2008)Visual Studio integration (2005 and 2008)–– Toolbox panelToolbox panel–– Context menusContext menus–– Developer HelpDeveloper Help–– Developer SamplesDeveloper Samples–– Web Mapping Application templateWeb Mapping Application template

Page 12: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web Application Developer FrameworkWeb Application Developer FrameworkWeb Application Developer Framework

Page 13: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF developer librariesWeb ADF developer libraries

•• AssembliesAssemblies–– Web ADF (native .NET)Web ADF (native .NET)–– ArcObjects (COM Interop)ArcObjects (COM Interop)

•• ArcObjects COM type librariesArcObjects COM type libraries

Page 14: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF ControlsWeb ADF Controls

•• AJAX enabledAJAX enabled•• MultiMulti--source consolidationsource consolidation

–– Resource blendingResource blending•• Rich outRich out--ofof--thethe--boxbox

functionality functionality

•• Visual Studio integrationVisual Studio integration

Page 15: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF JavaScriptWeb ADF JavaScript

•• Enhances the Web ADF Web Controls and FrameworkEnhances the Web ADF Web Controls and Framework–– Client side functionality and behaviorsClient side functionality and behaviors

•• Built using ASP.NET AJAX as the base client libraryBuilt using ASP.NET AJAX as the base client library–– Support for well known MS AJAX PatternsSupport for well known MS AJAX Patterns–– Documention provided on MSDNDocumention provided on MSDN

•• Event DrivenEvent Driven–– Respond to map events directly in browser using a Scriptable MapRespond to map events directly in browser using a Scriptable Map

ControlControl•• Object OrientedObject Oriented

–– Full object model and SDK detailing how to use itFull object model and SDK detailing how to use it

Page 16: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

ASP.NET AJAX and 9.3ASP.NET AJAX and 9.3

Web ADF JavaScript files

ArcGIS Server .NET Web ADF

Microsoft .NET Framework

Client-side Server-side

Web ADFJavaScript Library

Microsoft .NET FrameworkMicrosoft AJAX Library

ArcGIS Server .NET Web ADF

Microsoft ASP.NET AJAX

9.29.29.39.3

Page 17: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF Data SourcesWeb ADF Data Sources

•• Generic framework for supporting multiple ServicesGeneric framework for supporting multiple Services•• Manages interaction between Web controls and data sourcesManages interaction between Web controls and data sources•• Extensible architectureExtensible architecture

Page 18: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF GraphicsWeb ADF Graphics

•• Drawn on top of layers in the mapDrawn on top of layers in the map• Used to perform tasks such as:

– Highlighting features (select)– Labeling text– Displaying buffers– Geocoding– Displaying dynamic data (GPS)

•• Rendering occurs independently from the mapRendering occurs independently from the map

–– Does not require a map redrawDoes not require a map redraw

Page 19: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF TasksWeb ADF Tasks

•• Visual componentsVisual components•• Perform set of related actionsPerform set of related actions•• Generate resultsGenerate results•• Encapsulate workflowEncapsulate workflow

–– Provide user interface (UI)Provide user interface (UI)for gathering inputfor gathering input

–– Perform some action based on inputsPerform some action based on inputs–– Generate resultsGenerate results

Page 20: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

The ADF Task FrameworkThe ADF Task Framework

•• Framework provides for:Framework provides for:–– Configuring tasks in VS.NET and ManagerConfiguring tasks in VS.NET and Manager–– Organization of tasksOrganization of tasks–– Feedback when a task is executingFeedback when a task is executing–– Management of resultsManagement of results

•• DisplayDisplay•• Visualization on MapVisualization on Map•• Delete, Refresh, ReDelete, Refresh, Re--runrun

–– Distributable UI componentsDistributable UI components•• Plugs into ManagerPlugs into Manager

•• ExtensibleExtensible

CustomTask

Visual S

tudio

Visual S

tudio

Manager

Manager

Page 21: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF development paths Web ADF development paths

•• Web Mapping Application TemplateWeb Mapping Application Template

•• Web ADF Web controlsWeb ADF Web controls

•• Developer APIDeveloper API’’ss–– Common data source APICommon data source API–– SOAPSOAP–– ArcObjectsArcObjects

Page 22: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

•• ArcGIS Server Manager ArcGIS Server Manager –– Set required parametersSet required parameters–– Map, table of contentsMap, table of contents–– Theme, hyperlinksTheme, hyperlinks–– Can modify in Visual StudioCan modify in Visual Studio

•• Visual Studio template Visual Studio template –– Same files as Same files as

ArcGIS Server ManagerArcGIS Server Manager•• ASP.NET Web SiteASP.NET Web Site

–– Create with Web ControlsCreate with Web Controls

Options for creating Web ADF applicationsOptions for creating Web ADF applications

Page 23: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Advantages of using the templateAdvantages of using the template

•• Start with a complete Start with a complete GIS Web applicationGIS Web application

•• The template provides: The template provides: –– Measure user controlMeasure user control–– Identify toolIdentify tool–– Layout DIVs Layout DIVs –– resize, etc.resize, etc.–– Docking itemsDocking items–– ThemesThemes–– Help systemHelp system

Page 24: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

•• Property settingsProperty settings–– Assigned in web.configAssigned in web.config

•• Stored in App_ThemesStored in App_Themes

•• ComponentsComponents–– ImagesImages–– Skins (.skin)Skins (.skin)–– Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)

Web Mapping Application TemplateWeb Mapping Application TemplateThemesThemes

Page 25: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

DEMODEMO

Web Mapping Application Web Mapping Application

Page 26: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Getting started with Web ADF controlsGetting started with Web ADF controls

•• Resource manager controlsResource manager controls–– Not visible at run timeNot visible at run time–– Manage resourcesManage resources

•• Mapping controlsMapping controls–– MapMap–– Overview mapOverview map

•• Related controlsRelated controls–– ToolbarToolbar–– Table of contentsTable of contents

Page 27: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Map resource managerMap resource manager

•• Manages a collection of resource itemsManages a collection of resource items–– Resource definitionResource definition

•• Name displays in the table of contentsName displays in the table of contents•• Type determines the Type determines the

data sourcedata source–– Display settingsDisplay settings

•• TransparencyTransparency•• Background colorBackground color•• Request MIME dataRequest MIME data

Page 28: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Map controlMap control

•• Associate with a Map resource manager controlAssociate with a Map resource manager control•• Works with multiple map resourcesWorks with multiple map resources

–– Create dynamic map imagesCreate dynamic map images–– Fetch preFetch pre--generated image tilesgenerated image tiles

(cached services)(cached services)•• Image blendingImage blending

–– Web tier or browser Web tier or browser •• GameGame--style navigationstyle navigation

–– Seamless pan and zoomSeamless pan and zoom–– Keyboard and mouse integrationKeyboard and mouse integration

Page 29: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Toolbar controlToolbar control

•• Contains collection of toolbar itemsContains collection of toolbar items–– ToolTool–– CommandCommand–– DropDownBoxDropDownBox–– SeparatorSeparator–– SpaceSpace

•• At run time, displays collection of toolsAt run time, displays collection of tools–– OutOut--ofof--thethe--boxbox–– CustomCustom

•• Buddy with Map or PageLayout controlBuddy with Map or PageLayout control

Page 30: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Toc controlToc control

•• Lists map layers Lists map layers •• Supports multiple data sourcesSupports multiple data sources•• Buddy with Map or PageLayout controlBuddy with Map or PageLayout control•• Inherits TreeViewPlus controlInherits TreeViewPlus control

–– Supports Extensible Markup Supports Extensible Markup Language (XML) databindingLanguage (XML) databinding

•• AsynchronousAsynchronous

Page 31: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

OverviewMap controlOverviewMap control

•• Shows interactive area of interestShows interactive area of interest•• Displays GIS resourcesDisplays GIS resources

–– Can differ from mapCan differ from map•• StaticMode booleanStaticMode boolean

–– True: ReTrue: Re--use map imageuse map image–– False: Regenerate map imageFalse: Regenerate map image

•• Buddy with a Map controlBuddy with a Map control–– Uses a MapResourceManagerUses a MapResourceManager–– Same spatial referenceSame spatial reference

OverviewMap control

Map control

Page 32: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

MapTips control MapTips control

•• Displays attributesDisplays attributes•• Creates interactive graphicsCreates interactive graphics•• Map service must return geometryMap service must return geometry

–– Points, lines, polygonsPoints, lines, polygons•• Works withWorks with

–– ArcGIS ServerArcGIS Server–– ArcIMSArcIMS–– Web ADF graphicsWeb ADF graphics

•• Buddy with Map controlBuddy with Map control

Page 33: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

ContextMenu controlContextMenu control

•• Associate with any element in the pageAssociate with any element in the page•• Set ContextMenu propertiesSet ContextMenu properties

–– BackColor makes control visible at runtimeBackColor makes control visible at runtime–– Other properties are optionalOther properties are optional

•• Write code to:Write code to:–– Add context menu itemsAdd context menu items–– Show context menu at runtimeShow context menu at runtime–– Handle click eventHandle click event

Design time

Run time

Page 34: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Other controls Other controls

•• FloatingPanelFloatingPanel–– Container for other Web controlsContainer for other Web controls–– Rendered as CSS in browserRendered as CSS in browser

•• MagnifierMagnifier–– Floating window over Map controlFloating window over Map control–– Zoom to main mapZoom to main map

•• ZoomLevelZoomLevel–– PrePre--defined map scale intervalsdefined map scale intervals–– Cached and dynamic servicesCached and dynamic services

•• NavigationNavigation–– PrePre--defined pan speeddefined pan speed

Page 35: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

DEMODEMO

Web ADF Web ControlsWeb ADF Web Controls

Page 36: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Working with the Web ADF JavaScript LibraryWorking with the Web ADF JavaScript Library

•• Public script API of Web ADF controlsPublic script API of Web ADF controls•• Built on Microsoft ASP.NET AJAXBuilt on Microsoft ASP.NET AJAX•• Web ADF server controls are scriptableWeb ADF server controls are scriptable

–– Represented in JavaScript as componentsRepresented in JavaScript as components–– Use JavaScript to interact with control on the clientUse JavaScript to interact with control on the client--sideside

•• ClientClient--side object modelside object model–– GeometryGeometry–– SymbologySymbology–– Layers (serverLayers (server--side and clientside and client--side)side)–– Callouts and MapTipsCallouts and MapTips

Page 37: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Getting started with the Map client controlGetting started with the Map client control

•• Access the Map using JavaScriptAccess the Map using JavaScript

•• Set properties (get_ and set_)Set properties (get_ and set_)–– extent, mouseMode, layersextent, mouseMode, layers

•• Call functionsCall functions–– Navigation: zoom, zoomTo, panToNavigation: zoom, zoomTo, panTo–– Graphics: addGraphic, removeGraphicGraphics: addGraphic, removeGraphic–– Geometry: getGeometryGeometry: getGeometry

•• Event handlers (add_event, remove_event)Event handlers (add_event, remove_event)–– click, extentChanged, onProgressclick, extentChanged, onProgress

Page 38: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF JavaScript ExamplesWeb ADF JavaScript Examples

•• Get the map object and add an event listenerGet the map object and add an event listener

•• Center map on a pointCenter map on a pointvar center = new ESRI.Geometries.Point(100,0)map.panTo(center);

Page 39: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Web ADF JavaScript OMDWeb ADF JavaScript OMD

var map = $find('Map1'); MapControl ID var scaleFactor = 2;var centerPoint = new ESRI.ADF.Geometries.Point(-110, 45);var useAnimation = true;map.zoom(scaleFactor, centerPoint, useAnimation);

Page 40: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

DEMODEMO

Web ADF JavaScriptWeb ADF JavaScript

4040

Page 41: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Developer APIDeveloper API’’s s –– Common Data SourceCommon Data Source

•• ArcGIS Server supports multiple data sourcesArcGIS Server supports multiple data sources–– ArcGIS Server, ArcIMS, ArcWeb services, OGC, GraphicsArcGIS Server, ArcIMS, ArcWeb services, OGC, Graphics

•• Common Datasource APICommon Datasource API–– Pure .NET classes for the Web ADFPure .NET classes for the Web ADF–– Access and interact with all data sources the same wayAccess and interact with all data sources the same way

•• Provides different functionalities Provides different functionalities -- query, find, identityquery, find, identity……

Common data source API

Page 42: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Advantages of the Common Data Source APIAdvantages of the Common Data Source API

•• Removes business and GIS logic from Web controlsRemoves business and GIS logic from Web controls•• Support for multiple data sources using the same APISupport for multiple data sources using the same API•• Easy to program against different data sources Easy to program against different data sources •• Implement your own custom data sourcesImplement your own custom data sources

Page 43: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Data sourceData source--specific APIsspecific APIs

•• Support for data source specific capabilitiesSupport for data source specific capabilities–– ArcGIS ServerArcGIS Server–– ArcIMSArcIMS–– ArcWeb ServicesArcWeb Services

•• Example: ArcObjects APIExample: ArcObjects API–– Access to the fineAccess to the fine--grained ArcObjectsgrained ArcObjects

•• What does this mean?What does this mean?–– Many other data sourceMany other data source--

specific classes availablespecific classes available–– More business/GIS logicMore business/GIS logic–– Different APIs use different communication protocolsDifferent APIs use different communication protocols–– Requires different programming patterns for each data sourceRequires different programming patterns for each data source

ESRI.ArcGIS.ADF.IMS.dll

ESRI.ArcGIS.ADF.ArcWebService.dll

ESRI.ArcGIS.ADF.ArcGISServer.dll

Page 44: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Extending the Web ADF toolbarExtending the Web ADF toolbar

•• Toolbar items execute client and server actions Toolbar items execute client and server actions

•• Command (like a button)Command (like a button)–– A click invokes server actionA click invokes server action

•• DropDrop--down boxdown box–– Select item to invoke server actionSelect item to invoke server action–– List layer names, data frames, etc.List layer names, data frames, etc.

•• ToolTool–– ClientClient--side action: Action performed in Web browserside action: Action performed in Web browser–– ServerServer--side action: Class to handle server tool actionside action: Class to handle server tool action

Page 45: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Creating a custom tool

1. Make a toolbar2. Add controls to it3. Choose a JavaScript for client-side action, if needed4. Create a class for the control’s server-side code5. Set control’s properties to connect to its client and server code

Page 46: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Creating controls on a toolbar

• Toolbar properties• ToolbarItems property• The Add button

– Items to Contents– Builds the toolbar

Page 47: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Define ClientDefine Client--side Actionside Action

•• The user The user ‘‘drawsdraws’’ a shape with the toola shape with the tool•• You decide which shape by setting ClientAction propertyYou decide which shape by setting ClientAction property

–– RectangleRectangle–– LineLine–– PointPoint–– PolygonPolygon–– CircleCircle–– OvalOval

Page 48: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Writing code for your toolWriting code for your tool

•• Create a class in App_code folder for the server actionCreate a class in App_code folder for the server action•• Implement IMapServerToolActionImplement IMapServerToolAction•• Use args paramater to get the MapUse args paramater to get the Map

Sub ServerAction(ByVal args as ToolEventArgs)

Dim map as Map = CType(args.Control,Map)Dim pargs as PointEventArgs = CType(args,PointEventArgs)map.CenterAt(pargs.ScreenPoint)

End Sub

Sub ServerAction(ByVal args as ToolEventArgs)

Dim map as Map = CType(args.Control,Map)Dim pargs as PointEventArgs = CType(args,PointEventArgs)map.CenterAt(pargs.ScreenPoint)

End Sub

Page 49: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Associating the code (the class) to a controlAssociating the code (the class) to a control

•• ToolbarItemsCollectionEditorToolbarItemsCollectionEditor•• Show PropertiesShow Properties•• ServerActionAssemblyServerActionAssembly•• ServerActionClassServerActionClass

Page 50: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

DEMODEMO

Extending the Web ADF ToolbarExtending the Web ADF Toolbar

Page 51: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Leveraging the task frameworkLeveraging the task framework

•• Page developerPage developer–– Use outUse out--ofof--thethe--box tasksbox tasks–– Add results directly to Add results directly to

TaskResults container TaskResults container •• Custom toolsCustom tools

–– Create User controlCreate User control•• Server control developerServer control developer

–– Extend existing tasks to modify Extend existing tasks to modify behaviorbehavior

–– Develop custom task to distribute Develop custom task to distribute and integrate with ArcGIS and integrate with ArcGIS Server ManagerServer Manager

CustomActions/Events

Out-of-the-box Web controls

Page developer

Page/Web control events

User controls

Composite Web controls

Extend Web controls

Server control developer

Page 52: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Tasks included with the ADFTasks included with the ADF

•• Configure without writing codeConfigure without writing code–– Similar to ArcGIS Server ManagerSimilar to ArcGIS Server Manager

•• Common tasksCommon tasks–– Search AttributesSearch Attributes–– Query AttributesQuery Attributes–– PrintPrint–– Find AddressFind Address

•• ResourceResource--specific tasksspecific tasks–– Find PlaceFind Place–– GeoprocessingGeoprocessing–– EditorEditor

Page 53: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

TaskManager controlTaskManager control

•• Organizes tasks in a Web applicationOrganizes tasks in a Web application•• Generates hierarchical XML at run timeGenerates hierarchical XML at run time

–– XML can be bound to ASP.NET menu or tree viewXML can be bound to ASP.NET menu or tree view–– BuddyControl property controls bindingBuddyControl property controls binding

XML + System.Web.UI.WebControls.Menu

=

Run timeDesign time

Page 54: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

TaskResults controlTaskResults control

•• Displays task results as nodes in tree viewDisplays task results as nodes in tree view•• Draws results in a mapDraws results in a map•• Produces interactive resultsProduces interactive results

–– Highlight feature as result setHighlight feature as result set–– Zoom or pan to featureZoom or pan to feature–– ReRe--run taskrun task–– Remove task resultsRemove task results

•• Handles events for nodesHandles events for nodes–– Add, click, select, remove Add, click, select, remove

Page 55: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Custom Web Task ImplementationCustom Web Task Implementation

•• Basic task implements ITaskBasic task implements ITask•• Create a custom Web control Create a custom Web control

–– Extend Task or FloatingPanelTask abstract base classesExtend Task or FloatingPanelTask abstract base classes

ESRI.ArcGIS.ADF.Web.UI.WebControls ESRI.ArcGIS.ADF.Web.UI.WebControls FloatingPanelFloatingPanel

ESRI.ArcGIS.ADF.Web.UI.WebControls ESRI.ArcGIS.ADF.Web.UI.WebControls FloatingPanelTaskFloatingPanelTask

CustomTaskCustomTask

ICallbackEventHandlerICallbackEventHandler

IBuddyControlSupportIBuddyControlSupport

ITaskITask

ASP.NET Web ControlsASP.NET Web Controls

Page 56: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

DEMODEMO

Web ADF Task FrameworkWeb ADF Task Framework

Page 57: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

WhatWhat’’s New at 9.3.1s New at 9.3.1

•• Map Tips templatesMap Tips templates•• Additional ResourcesAdditional Resources

–– Image ServerImage Server–– Virtual EarthVirtual Earth

•• User Control TasksUser Control Tasks•• Print Task templatesPrint Task templates•• Manager CustomizationManager Customization

–– Custom PanelsCustom Panels

Page 58: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Additional ResourcesAdditional Resources

•• Developer Summit ProceedingsDeveloper Summit Proceedings–– Archived recordings and presentationsArchived recordings and presentations–– http://gis.esri.com/library/userconf/devsummit08/index.html http://gis.esri.com/library/userconf/devsummit08/index.html

•• ArcGIS 9.3 OnArcGIS 9.3 On--line Seminarsline Seminars–– View a free Live Training Seminar or watch the recordingView a free Live Training Seminar or watch the recording–– www.esri.com/ltswww.esri.com/lts

•• ArcGIS Server TrainingArcGIS Server Training–– Introduction to ArcGIS ServerIntroduction to ArcGIS Server–– Developing Applications with ArcGIS Server for the Microsoft .NEDeveloping Applications with ArcGIS Server for the Microsoft .NET T

FrameworkFramework–– www.esri.com/trainingwww.esri.com/training

Page 59: Developing Applications with ArcGIS Server Using the ...€¦ · Developing Applications with ArcGIS Server Using ... –Local or remote ... –Developing Applications with ArcGIS

Questions and AnswersQuestions and Answers

Please fill out your evaluationsPlease fill out your evaluations