當前位置: 首頁>>代碼示例>>C#>>正文


C# AxMapControl類代碼示例

本文整理匯總了C#中AxMapControl的典型用法代碼示例。如果您正苦於以下問題:C# AxMapControl類的具體用法?C# AxMapControl怎麽用?C# AxMapControl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AxMapControl類屬於命名空間,在下文中一共展示了AxMapControl類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LoadGeoData

 public static void LoadGeoData(AxMapControl axMapControl1, AxMapControl axMapControl2, string strFileN)
 {
     string strFExtenN = System.IO.Path.GetExtension(strFileN);
     switch (strFExtenN)
     {
         case ".shp":
             {
                 string strPath = System.IO.Path.GetDirectoryName(strFileN);
                 string strFile = System.IO.Path.GetFileNameWithoutExtension(strFileN);
                 axMapControl1.AddShapeFile(strPath, strFile);
                 axMapControl2.ClearLayers();
                 axMapControl2.AddShapeFile(strPath, strFile);
                 axMapControl2.Extent = axMapControl2.FullExtent;
                 break;
             }
         case ".bmp":
         case ".tif":
         case ".jpg":
         case ".img":
             {
                 IWorkspaceFactory pWSF = new RasterWorkspaceFactoryClass();
                 string pathName = System.IO.Path.GetDirectoryName(strFileN);
                 string fileName = System.IO.Path.GetFileName(strFileN);
                 IWorkspace pWS = pWSF.OpenFromFile(pathName, 0);
                 IRasterWorkspace pRWS = pWS as IRasterWorkspace;
                 IRasterDataset pRasterDataSet = pRWS.OpenRasterDataset(fileName);
                 IRasterPyramid pRasPyramid = pRasterDataSet as IRasterPyramid;
                 if (pRasPyramid != null)
                 {
                     if (!(pRasPyramid.Present))
                     {
                         pRasPyramid.Create();
                     }
                 }
                 IRaster pRaster = pRasterDataSet.CreateDefaultRaster();
                 IRasterLayer pRasterLayer = new RasterLayerClass();
                 pRasterLayer.CreateFromRaster(pRaster);
                 ILayer pLayer = pRasterLayer as ILayer;
                 axMapControl1.AddLayer(pLayer, 0);
                 axMapControl2.ClearLayers();
                 axMapControl2.AddLayer(pLayer, 0);
                 axMapControl2.Extent = axMapControl2.FullExtent;
                 break;
             }
         case ".mxd":
             {
                 if (axMapControl1.CheckMxFile(strFExtenN))
                 {
                     axMapControl1.LoadMxFile(strFExtenN);
                 }
                 else
                     MessageBox.Show("所選擇的文件不是Mxd文件!", "提示信息");
                 break;
             }
         default:
             break;
     }
 }
開發者ID:Krystal001025,項目名稱:temp,代碼行數:58,代碼來源:GeoMapLoad.cs

示例2: CreateShpFileForm

 public CreateShpFileForm(AxMapControl _axMapControl, DataGridView _DataView, string path)
 {
     axMapControl = _axMapControl;
     excelDataGridViewX = _DataView;
     m_bin_path = path;
     InitializeComponent();
 }
開發者ID:niwho,項目名稱:ArcGISFundation,代碼行數:7,代碼來源:CreateShpFileForm.cs

示例3: MainWindowViewModel

 public MainWindowViewModel(AxMapControl axMapControl)
 {
     _axMapControl = axMapControl;
     _shapeOp=new ShapeOp(string.Empty);
     _mapIndex=new Dictionary<string, int>(5);
     InitializeCommand();
 }
開發者ID:gaufung,項目名稱:Accessibility,代碼行數:7,代碼來源:MainWindowViewModel.cs

示例4: frmRaterSym1

 public frmRaterSym1(IRasterLayer rasLayer, AxMapControl mapcontrol, AxTOCControl toccontrol)
 {
     InitializeComponent();
     this.rasterlayer = rasLayer;
     axmapcontrol = mapcontrol;
     axtoccontrol = toccontrol;
 }
開發者ID:xfgxfg,項目名稱:CropWatchField,代碼行數:7,代碼來源:frmRaterSym1.cs

示例5: Init

        private void Init(AxMapControl mc, int programID)
        {
            gp = new Geoprocessor();
            mapControl = mc;
            UpdateMapLayerNameList(mapLayerNameList, mapControl);
            program = new Program();
            program.id = programID;
            program.select();
            project = new Project();
            project.id = program.projectID;
            project.select();
            netSize = program.getRelatedNetSize();
            conditionList = program.getAllRelatedCondition();
            baseFeature = GisUtil.GetBaseFeature(mapControl, project.baseMapIndex);
            mapFolder = System.IO.Path.GetDirectoryName(project.path);
            targetFolder = generateFolder(mapFolder);
            foreach (Condition condition in conditionList)
            {
                if (condition.type == C.CONFIG_TYPE_STANDARD)
                {
                    totalStandardValue += condition.value;
                }
            }
            fishnetPolygonName = "polygon.shp";
            fishnetName = "fishnet.shp";
            fishnetWidth = netSize.width;
            fishnetHeight = netSize.height;

            featureList = new List<Feature>();
        }
開發者ID:wingzhangmaybe,項目名稱:CGXM,代碼行數:30,代碼來源:SiteSelector.cs

示例6: Coordinate

        public Coordinate(AxMapControl axMapControl)
        {
            //  this.ply = plo;

            this.mapControl = axMapControl;
            InitializeComponent();
        }
開發者ID:AgentWord,項目名稱:SiPing,代碼行數:7,代碼來源:Coordinate.cs

示例7: Buffer_Load

        //窗口啟動程序
        private void Buffer_Load(object sender, EventArgs e)
        {
            AxMapControl axMapControl1=new AxMapControl();
            //m_hookHelper.Hook = axMapControl1.Object;
            if (null == m_hookHelper || null == m_hookHelper.Hook || 0 == m_hookHelper.FocusMap.LayerCount)
                return;

            //load all the feature layers in the map to the layers combo
            IEnumLayer layers = GetLayers();
            layers.Reset();
            ILayer layer = null;
            while ((layer = layers.Next()) != null)
            {
                cboLayers.Items.Add(layer.Name);
            }
            //select the first layer
            if (cboLayers.Items.Count > 0)
                cboLayers.SelectedIndex = 0;

               // string tempDir = System.IO.Path.GetTempPath();
            string tempDir = SystemSet.Base_Map+"\\處理數據庫\\實驗數據";
            txtOutputPath.Text = System.IO.Path.Combine(tempDir, ((string)cboLayers.SelectedItem + "_buffer.shp"));

            //set the default units of the buffer
            m_hookHelper.FocusMap.MapUnits = esriUnits.esriMeters;
            CNunit.SelectedIndex = 0;
              /*   int units = Convert.ToInt32(m_hookHelper.FocusMap.MapUnits);
            cboUnits1.SelectedIndex = units;
               */
        }
開發者ID:AgentWord,項目名稱:SiPing,代碼行數:31,代碼來源:Buffer.cs

示例8: frmSymbol

 public frmSymbol(IFeatureLayer featLayer,AxMapControl mapcontrol,AxTOCControl toccontrol)
 {
     InitializeComponent();
     this.Layer = featLayer;
     axmapcontrol = mapcontrol;
     axtoccontrol = toccontrol;
 }
開發者ID:xfgxfg,項目名稱:CropWatchField,代碼行數:7,代碼來源:frmSymbol.cs

示例9: init

        public void init(int programID, AxMapControl mc, AxToolbarControl tc, MainWindow mw)
        {
            inited = true;

            program = new Program();
            program.id = programID;
            program.select();

            mapControl = mc;
            toolbarControl = tc;
            mainWindow = mw;
            mainRoadList = program.getAllRelatedMainRoad();
            if (mainRoadList == null)
                mainRoadList = new ObservableCollection<MainRoad>();

            foreach (MainRoad mainRoad in mainRoadList)
            {
                GisUtil.DrawPolylineElement(mainRoad.lineElement, mapControl);   
            }

            valid = isValid();
            dirty = false;

            mapControlMouseDown = null;
            MainRoadListBox.ItemsSource = mainRoadList;
        }
開發者ID:Leooonard,項目名稱:CGXM,代碼行數:26,代碼來源:SelectMainRoadUserControl.xaml.cs

示例10: Tend

        public Tend(IHookHelper hookHelper,AxMapControl amap)
        {
            this.axmapcontrol = amap;

            this.m_hookHelper = hookHelper;
            InitializeComponent();
        }
開發者ID:AgentWord,項目名稱:SiPing,代碼行數:7,代碼來源:Tend.cs

示例11: FrameSearchTool

 public FrameSearchTool(AxMapControl axMapControl,MainForm Father,string LayerName,bool Statistic=false)
 {
     this.Father = Father;
     this.axMapControl = axMapControl;
     this.LayerName = LayerName;
     this.StatisticFlag = Statistic;
 }
開發者ID:LooWooTech,項目名稱:Traffic,代碼行數:7,代碼來源:FrameSearchTool.cs

示例12: init

        public void init(int programID, AxMapControl mc, AxToolbarControl tc, MainWindow mw)
        {
            inited = true;

            program = new Program();
            program.id = programID;
            program.select();

            mapControl = mc;
            toolbarControl = tc;
            mainWindow = mw;

            OnFinish configUserControlOnFinish = delegate(bool finish)
            {
                TabItem configTabItem = ProgramTabControl.FindName("ConfigTabItem") as TabItem;
                Grid grid = configTabItem.Header as Grid;
                TextBlock textBlock = grid.Children[0] as TextBlock;
                if(finish)
                {
                    textBlock.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#7CFC00"));                    
                }
                else
                {
                    textBlock.Foreground = new SolidColorBrush(Colors.Black);                                        
                }
            };
            ConfigUserControl.init(programID, mapControl, configUserControlOnFinish, mainWindow);

            OnFinish siteSelectorUserControlOnFinish = delegate(bool finish)
            {
                TabItem configTabItem = ProgramTabControl.FindName("SiteSelectorTabItem") as TabItem;
                Grid grid = configTabItem.Header as Grid;
                TextBlock textBlock = grid.Children[0] as TextBlock;
                if (finish)
                {
                    textBlock.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#7CFC00"));
                }
                else
                {
                    textBlock.Foreground = new SolidColorBrush(Colors.Black);
                }
            };
            SiteSelectorUserControl.init(programID, siteSelectorUserControlOnFinish, mapControl, toolbarControl, mainWindow);
            OnFinish housePlacerUserControl = delegate(bool finish)
            {
                TabItem housePlacerTabItem = ProgramTabControl.FindName("HousePlacerTabItem") as TabItem;
                Grid grid = housePlacerTabItem.Header as Grid;
                TextBlock textBlock = grid.Children[0] as TextBlock;
                if (finish)
                {
                    textBlock.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#7CFC00"));
                }
                else
                {
                    textBlock.Foreground = new SolidColorBrush(Colors.Black);
                }
            };
            HousePlacerUserControl.init(programID, mapControl, housePlacerUserControl, mainWindow);
        }
開發者ID:Leooonard,項目名稱:CGXM,代碼行數:59,代碼來源:ProgramStepUserControl.xaml.cs

示例13: CopyAndOverwriteMap

 public void CopyAndOverwriteMap(AxMapControl mapcontrol, AxPageLayoutControl PageLayoutControl)
 {
     IObjectCopy objectCopy = new ObjectCopyClass();
     object toCopyMap = mapcontrol.Map;
     object copiedMap = objectCopy.Copy(toCopyMap);
     object toOverwriteMap = PageLayoutControl.ActiveView.FocusMap;
     objectCopy.Overwrite(copiedMap, ref toOverwriteMap);
 }
開發者ID:xfgxfg,項目名稱:HXCropWatchDB,代碼行數:8,代碼來源:RibbonForm.cs

示例14: DataConverTool

 public DataConverTool(DevComponents.DotNetBar.LabelX lab_progress, DevComponents.DotNetBar.LabelX lb, DevExpress.XtraEditors.MarqueeProgressBarControl progressBar, DevComponents.DotNetBar.Controls.RichTextBoxEx MessageShow,AxMapControl axMap)
 {
     this.axMapControl = axMap;
     this.lb = lb;
     this.lab_progress = lab_progress;
     this.progressBar = progressBar;
     this.MessageShow = MessageShow;
 }
開發者ID:AgentWord,項目名稱:DataConverV2.0,代碼行數:8,代碼來源:DataConverTool.cs

示例15: CopyAndOverwriteMap

 public static void CopyAndOverwriteMap(AxMapControl map, AxPageLayoutControl page)
 {
     //獲取拷貝接口對象
     IObjectCopy objectCopy = new ObjectCopyClass();
     object toCopyMap = map.Map;
     object copiedMap = objectCopy.Copy(toCopyMap);//複製地圖到copiedMap
     object toOverWriteMap = page.ActiveView.FocusMap;//獲取視圖控件的焦點地圖
     objectCopy.Overwrite(copiedMap, ref toOverWriteMap);//複製地圖
 }
開發者ID:Krystal001025,項目名稱:temp,代碼行數:9,代碼來源:BasicMethod.cs


注:本文中的AxMapControl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。