当前位置: 首页>>代码示例>>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;未经允许,请勿转载。