ADF Web
ArcGIS Server ADF GeocodeConnection control 4-2
Web ArcGIS Server Application Developer Framework (ADF).NET interop semblies.net Web ADF GIS Server 4-3
.NET ADF Web Represent the views in ArcMap Page layout, map, overview Toolbar, TOC, North Arrow, etc. Match addresses using geocode server objects Impersonation 4-4
.NET ADF Web : ASP.NET Web.NET server objects Server API 4-5
Web controls buddy server object ToolbarControl TOCControl Buddy Control 4-6
AGSWebControl Host ServerObject ReleeServerContext ServerConnection ContentsChanged Get Get the the mapserver mapserver object object mapctrl1.host mapctrl1.host "Sparticle" "Sparticle" mapctrl1.serverobject mapctrl1.serverobject "RedlandsMap" "RedlandsMap" mapctrl1.dataframe mapctrl1.dataframe "RedlandsLayers" "RedlandsLayers" 4-7
Web Web GIS Web : : GIS Server API ArcObjects Web control (user interface) Convenience cls (GIS business logic) 4-8
Map control Map ImageUrl Draw Extent MapDescription CreateWebMap Public Public Sub Sub updatemapimage(byval updatemapimage(byval imgresult imgresult IImageResult) IImageResult) Map1.ImageUrl Map1.ImageUrl imgresult.url imgresult.url Map1.Draw() Map1.Draw() Sub Sub 4-9
Map : Map Circle DragRectangle MapClick Private Private Sub Sub Map1_MapClick(ByVal Map1_MapClick(ByVal sender sender System.Object, System.Object, ByVal ByVal args args ESRI.ArcGIS.Server.WebControls.PointEventArgs) ESRI.ArcGIS.Server.WebControls.PointEventArgs) Handles Handles Map1.MapClick Map1.MapClick screenpoint screenpoint System.Drawing.Point System.Drawing.Point screenpoint screenpoint args.screenpoint args.screenpoint...... Sub Sub 4-10
Map WebMap MapServer DefaultMapDescription ManageLifetime ConvertRecordSetToDataSet ReleeServerContext ServerContext Refresh webmap webmap WebMap WebMap Map1.CreateWebMap() Map1.CreateWebMap() Try Try webmap.drawfullextent() webmap.drawfullextent() webmap.refresh webmap.refresh Finally Finally webmap.dispose() webmap.dispose() Try Try 4-11
WebMap: server object WebMap server object ArcObjects Map control (User interface) WebMap (Convenience cls) webmap webmap webmap webmap Try Try webmap webmap Map1.CreateWebMap Map1.CreateWebMap mapdesc mapdesc IMapDescription IMapDescription webmap.mapdescription webmap.mapdescription mpsvr mpsvr IMapServer IMapServer webmap.mapserver webmap.mapserver mpsvrinfo mpsvrinfo IMapServerInfo IMapServerInfo mpsvrinfo mpsvrinfo mpsvr.getserverinfo(mpsrv.defaultmapname) mpsvr.getserverinfo(mpsrv.defaultmapname) mpsbookmark mpsbookmark IMapServerBookmarks IMapServerBookmarks mpsbookmark mpsbookmark mapserverinfo.bookmarks mapserverinfo.bookmarks bookmark bookmark IMapServerBookmark IMapServerBookmark bookmark bookmark mapserverbookmarks.get_element(1) mapserverbookmarks.get_element(1) maparea maparea IMapArea IMapArea bookmark bookmark mapdesc.maparea mapdesc.maparea maparea maparea webmap.mapdescription webmap.mapdescription mapdesc mapdesc webmap.refresh() webmap.refresh() Finally Finally webmap.dispose webmap.dispose Try Try 4-12
Page layout ToolItems CreateWebPageLayout PageDescription WebLayoutImage webimage webimage WebLayoutImage WebLayoutImage webimage webimage PageLayout1.WebLayoutImage PageLayout1.WebLayoutImage layoutcoll layoutcoll LayoutImageDataFrameInfoCollection LayoutImageDataFrameInfoCollection layoutinfo layoutinfo LayoutImageDataFrameInfo LayoutImageDataFrameInfo layoutcoll layoutcoll webimage.maps webimage.maps layoutinfo layoutinfo layoutcoll.item(0) layoutcoll.item(0) visibleextent visibleextent System.Drawing.Rectangle System.Drawing.Rectangle visibleextent layoutinfo.visiblelocationonimage() visibleextent layoutinfo.visiblelocationonimage() 4-13
Page layout WebPageLayout server object ArcObjects PageDrawExtent FromPagePoint ServerObject Export WebToc IsPooled pglayout pglayout WebPageLayout WebPageLayout Try Try pglayout pglayout PageLayout1.CreateWebPageLayout() PageLayout1.CreateWebPageLayout() env env IEnvelope IEnvelope env env pglayout.servercontext.createobject( esrigeometry.envelope ) pglayout.servercontext.createobject( esrigeometry.envelope ) env.putcoords(0,0,1,1) env.putcoords(0,0,1,1) pglayout.pagedrawextent(env) pglayout.pagedrawextent(env) Finally Finally pglayout.dispose() pglayout.dispose() Try Try 4-14
Overview map AOIExtent BuddyControl OVMapChanged WebMap mapextent mapextent Extent Extent mapextent mapextent New New Extent Extent (480821.28,3768550.94, (480821.28,3768550.94, 482268.11,3769892.34) 482268.11,3769892.34) Specify Specify the the new new map map extent extent Map1.Extent Map1.Extent mapextent mapextent Map1.Draw() Map1.Draw() Specify Specify Area Area of of Interest Interest for for Overview Overview Map Map OverviewMap1.AOIExtent mapextent OverviewMap1.AOIExtent mapextent OverviewMap1.Draw() OverviewMap1.Draw() 4-15
session state Web session state Image MapDescription ServerContext Extent page IDs <page><control id> : MapDescription Default.pxMap1_md 4-16
Session state Web server context session state object server context session state context Check Check session session for for ServerContext ServerContext sess_ctx sess_ctx String String sess_ctx sess_ctx String.Format( servercontext_sparticle_redlandsmapobj ) String.Format( servercontext_sparticle_redlandsmapobj ) sessobj sessobj object object Session(sess_ctx) Session(sess_ctx) If If Not Not sessobj sessobj Is Is Nothing Nothing Then Then 'ServerContext 'ServerContext saved saved in in session session for for non-pooled non-pooled SO SO sc sc IServerContext IServerContext sessobj sessobj Work Work with with the the servercontext servercontext If If 4-17
Web session state server object Server object :,, 4-18
MapDescription server object 1. Web server object WebMap::ApplyMapDescriptionToServer 2. server object 3. server object WebMap::RefreshServerObjects 4. WebMap Update Update Server Server Object Object webmap webmap WebMap WebMap Map1.CreateWebMap() Map1.CreateWebMap() webmap.applymapdescriptiontoserver() webmap.applymapdescriptiontoserver() Make Make fine-grained fine-grained changes changes mapserverobj mapserverobj IMapServerObjects IMapServerObjects mapserverobj mapserverobj webmap.mapserver webmap.mapserver map map IActiveView IActiveView map map mapserverobj.map( Default ) mapserverobj.map( Default ) map.clearlayers() map.clearlayers() Update Update map map server server and and webmap webmap webmap.refreshserverobjects() webmap.refreshserverobjects() webmap.refresh() webmap.refresh() 4-19
server context server objects WebMap::Dispose WebMap server context server objects WebMap::Dispose WebMap server context session server context WebMap::ReleeServerContext Using(WebMap Using(WebMap webmap webmap Map1.CreateWebMap()) Map1.CreateWebMap()) { { ) ) webmap webmap WebMap WebMap Map1.CreateWebMap() Map1.CreateWebMap() Try Try...... Finally Finally webmap.dispose webmap.dispose Try Try Sub Sub Session_(ByVal Session_(ByVal sender sender Object, Object, ByVal ByVal e e EventArgs) EventArgs) obj obj Object Object For For i i 0 0 To To Session.Count Session.Count - - 1 1 obj obj Session(i) Session(i) If If TypeOf TypeOf obj obj Is Is WebPageLayout WebPageLayout Then Then pglayout pglayout WebPageLayout WebPageLayout pglayout pglayout obj obj pglayout.releeservercontext() pglayout.releeservercontext() If If Next Next Session.RemoveAll() Session.RemoveAll() Sub Sub 4-20
.NET : WebObject webobject webobject WebObject WebObject New New WebObject WebObject webobject.managelifetime(cursor) webobject.managelifetime(cursor)...... webobject.dispose() webobject.dispose() 4-21
ArcGIS Server ADF GeocodeConnection control 4-22
GeocodeConnection geocode server object System.Component.Model.Component : WebGeocode 4-23
GeocodeConnection GeocodeConnection Host, ServerObject ShowAllCandidates MinimumMatchScore CreateWebGeocode WebGeocodeCode LocatorProperties ServerContext GeocodeAddress geocodeconnection1.host geocodeconnection1.host Sparticle Sparticle geocodeconnection1.serverobject geocodeconnection1.serverobject RedlandsGeocode RedlandsGeocode webgeocode webgeocode WebGeocode WebGeocode webgeocode webgeocode geocodeconnnection1.createwebgeocode geocodeconnnection1.createwebgeocode propset propset IPropertySet IPropertySet propset propset webgeocode.locatorproperties webgeocode.locatorproperties names() names() Object Object values() values() Object Object name name Object Object value value Object Object propset.getallproperties(names,values) propset.getallproperties(names,values) Get Get the the properties properties For For Each Each name name in in names names Response.Write(name) Response.Write(name) Next Next For For Each Each value value in in values values Response.Write(value) Response.Write(value) Next Next 4-24
TOC Toolbar NorthArrow ScaleBar Impersonation 4-25
ToolbarControl TOCControl buddy : active tool, layer visibility Tool Toolbar TOC Buddy Control 4-26
Buddy TOC buddy Overview buddy Toolbar buddy 4-27
buddy buddy control TOC::BuddyControl OverviewMap::BuddyControl Toolbar::BuddyControls 'set 'set the the TOC TOC buddy buddy Toc1.BuddyControl Toc1.BuddyControl "Map1" "Map1" 'set 'set the the toolbar toolbar buddy buddy Toolbar1.BuddyControlType Toolbar1.BuddyControlType BuddyControlType.Map BuddyControlType.Map Toolbar1.EnableViewState Toolbar1.EnableViewState True True buddycontrolcol buddycontrolcol BuddyControlCollection BuddyControlCollection buddycontrolcol buddycontrolcol Toolbar1.BuddyControls Toolbar1.BuddyControls buddymap buddymap BuddyControl BuddyControl New New BuddyControl BuddyControl buddymap.name buddymap.name "Map1" "Map1" buddycontrolcol.add(buddymap) buddycontrolcol.add(buddymap) 4-28
: TOC control : WebTOC WebMap WebPageLayout webmap webmap WebMap WebMap Map1.CreateWebMap Map1.CreateWebMap webtoc webtoc WebToc WebToc webmap.webtoc(webimageformat.bmp, webmap.webtoc(webimageformat.bmp, False, False, Nothing) Nothing) tocdataframe tocdataframe TocDataFrame TocDataFrame tocitem tocitem TocItem TocItem tocdataframe tocdataframe webtoc.find("redlands webtoc.find("redlands Schools") Schools") tocitem tocitem tocdataframe.find("streets") tocdataframe.find("streets") islayervisible islayervisible Boolean Boolean If If tocitem.visiblity tocitem.visiblity LayerVisibility.NotVisible LayerVisibility.NotVisible Then Then islayervisible islayervisible False False If If 4-29
: : Web : 4-30
: Impersonation Web GIS server Win32 API LogonUser agsusers agsadmin 4-31
: Toolbar Toolbar items Tool Command Space Separator 4-32
toolbar ToolbarItem Collection ToolbarItemCollection::Add Public Public sub sub addtool(toolitem addtool(toolitem ToolBarItem) ToolBarItem) Toolbar1.ToolbarItems.Clear() Toolbar1.ToolbarItems.Clear() Toolbar1.ToolbarItems.Add(toolItem); Toolbar1.ToolbarItems.Add(toolItem); Sub Sub 4-33
Tools : JavaScript Tool (e.g., ZoomIn tool) Client-side action (DragRectangle) JavaScript JavaScript fires server-side action Server-side action (Zooms in to specified region) 4-34
JavaScript All documented ( 5) ClientToolAction JavaScript MapClientToolAction JavaScript Function PageLayoutClientToolAction JavaScript Function Point MapPoint Point PagePoint DragImage MapDragImage DragImage PageDragImage DragRectangle MapDragRectangle DragRectangle PageDragRectangle Line MapLine MapDragImage PageMapDragImage Oval MapOval MapDragRectangle PageMapDragRectangle Polygon MapPolygon MapPoint PageMapPoint Polyline MapPolyline Circle MapCircle 4-35
Sends request to server object to access to the map ESRI.ArcGIS.Server.WebControls.Tools namespace 4-36
toolbar Tool::ClientToolAction Tool::ServerToolActionsembly Tool::ServerToolActionCls ToolbarItems Collection zoomintool zoomintool Tool Tool New New Tool("MapZoomIn") Tool("MapZoomIn") zoomintool.clienttoolaction zoomintool.clienttoolaction "DragRectangle" "DragRectangle" zoomintool.servertoolactionsembly zoomintool.servertoolactionsembly "ESRI.ArcGIS.Server.WebControls" "ESRI.ArcGIS.Server.WebControls" zoomintool.servertoolactioncls zoomintool.servertoolactioncls "ESRI.ArcGIS.Server.WebControls.Tools.MapZoomIn" "ESRI.ArcGIS.Server.WebControls.Tools.MapZoomIn" zoomintool.text zoomintool.text "MapZoomIn" "MapZoomIn" zoomintool.name zoomintool.name "ZoomIn" "ZoomIn" Toolbar1.ToolbarItems.Add(zoomInTool) Toolbar1.ToolbarItems.Add(zoomInTool) 4-37
MapToolItems/PageToolItems : HTML button MapToolItem Collection <INPUT <INPUT id"button1" id"button1" onclick"mapdragrectangle('map1','magnify',true)" onclick"mapdragrectangle('map1','magnify',true)" type"button" type"button" value Magnify" value Magnify" style"z-index: style"z-index: 102; > 102; > 4-38
: ServerToolActionCls - MapZoomIn Map::DrawRectangle Private Private Sub Sub Map1_DragRectangle(ByVal Map1_DragRectangle(ByVal sender sender Object, Object, ByVal ByVal args args ToolEventArgs) ToolEventArgs) Handles Handles Map1.DragRectangle Map1.DragRectangle If If args.toolname args.toolname Magnify" Magnify" Then Then rectargs rectargs RectangleEventArgs RectangleEventArgs rectargs rectargs args args pt1 pt1 New New ScreenPoint ScreenPoint pt1.x pt1.x rectargs.screenextent.left rectargs.screenextent.left pt1.y pt1.y rectargs.screenextent.bottom rectargs.screenextent.bottom...... 4-39
4 Web,,,TOC Toolbar Host, server object BuddyControls TOC API 4-40
server object??? 4-41