ADFTutorials_VBNet\AccessArcIMS\App_Code\PointTool.vb
' Copyright 2010 ESRI ' ' All rights reserved under the copyright laws of the United States ' and applicable international laws, treaties, and conventions. ' ' You may freely redistribute and use this sample code, with or ' without modification, provided you include the original copyright ' notice and use restrictions. ' ' See the use restrictions. ' Imports Microsoft.VisualBasic Imports System Imports System.Data Imports System.Configuration Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools Imports ESRI.ArcGIS.ADF.Web.UI.WebControls Imports ESRI.ArcGIS.ADF.Web.DataSources.IMS Imports ESRI.ArcGIS.ADF.IMS.Display.AcetateElement Imports ESRI.ArcGIS.ADF.IMS.Display.Symbol Imports ESRI.ArcGIS.ADF.IMS.Carto Imports ESRI.ArcGIS.ADF.IMS.Carto.Layer ''' <summary> ''' Summary description for PointTool ''' </summary> Public Class PointTool Implements IMapServerToolAction Public Sub ServerAction(ByVal args As ToolEventArgs) Implements IMapServerToolAction.ServerAction Dim mapctrl As ESRI.ArcGIS.ADF.Web.UI.WebControls.Map mapctrl = CType(args.Control, ESRI.ArcGIS.ADF.Web.UI.WebControls.Map) Dim mpea As MapPointEventArgs = CType(args, MapPointEventArgs) Dim ims_map_point As ESRI.ArcGIS.ADF.IMS.Geometry.Point = CType(ESRI.ArcGIS.ADF.Web.DataSources.IMS.Converter.ToIMSGeometry(mpea.MapPoint), ESRI.ArcGIS.ADF.IMS.Geometry.Point) Dim mf As ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality mf = CType(mapctrl.GetFunctionality("MapResourceItem0"), ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality) Dim mapview As ESRI.ArcGIS.ADF.IMS.Carto.MapView = mf.MapView Dim alayer As ESRI.ArcGIS.ADF.IMS.Carto.Layer.AcetateLayer = CType(mapview.Layers.FindByName("acetate_name"), ESRI.ArcGIS.ADF.IMS.Carto.Layer.AcetateLayer) If alayer Is Nothing Then alayer = New ESRI.ArcGIS.ADF.IMS.Carto.Layer.AcetateLayer() alayer.Name = "acetate_name" mapview.Layers.Add(alayer) End If alayer.Visible = True Dim ge As ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.GeometryElement = New ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.GeometryElement(ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.AcetateUnits.Database) ge.Element = ims_map_point Dim sms As ESRI.ArcGIS.ADF.IMS.Display.Symbol.SimpleMarkerSymbol = New ESRI.ArcGIS.ADF.IMS.Display.Symbol.SimpleMarkerSymbol() sms.Color = System.Drawing.Color.SpringGreen sms.Type = ESRI.ArcGIS.ADF.IMS.Display.Symbol.MarkerSymbolType.Star sms.OutlineColor = System.Drawing.Color.Black sms.Width = 24 ge.Symbol = sms Dim aec As ESRI.ArcGIS.ADF.IMS.Display.AcetateElement.AcetateElementCollection = alayer.AcetateElements aec.Add(ge) mapctrl.RefreshResource(mf.Resource.Name) End Sub End Class