本文整理汇总了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;
}
}
示例2: CreateShpFileForm
public CreateShpFileForm(AxMapControl _axMapControl, DataGridView _DataView, string path)
{
axMapControl = _axMapControl;
excelDataGridViewX = _DataView;
m_bin_path = path;
InitializeComponent();
}
示例3: MainWindowViewModel
public MainWindowViewModel(AxMapControl axMapControl)
{
_axMapControl = axMapControl;
_shapeOp=new ShapeOp(string.Empty);
_mapIndex=new Dictionary<string, int>(5);
InitializeCommand();
}
示例4: frmRaterSym1
public frmRaterSym1(IRasterLayer rasLayer, AxMapControl mapcontrol, AxTOCControl toccontrol)
{
InitializeComponent();
this.rasterlayer = rasLayer;
axmapcontrol = mapcontrol;
axtoccontrol = toccontrol;
}
示例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>();
}
示例6: Coordinate
public Coordinate(AxMapControl axMapControl)
{
// this.ply = plo;
this.mapControl = axMapControl;
InitializeComponent();
}
示例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;
*/
}
示例8: frmSymbol
public frmSymbol(IFeatureLayer featLayer,AxMapControl mapcontrol,AxTOCControl toccontrol)
{
InitializeComponent();
this.Layer = featLayer;
axmapcontrol = mapcontrol;
axtoccontrol = toccontrol;
}
示例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;
}
示例10: Tend
public Tend(IHookHelper hookHelper,AxMapControl amap)
{
this.axmapcontrol = amap;
this.m_hookHelper = hookHelper;
InitializeComponent();
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);//复制地图
}