2024年3月25日发(作者:)

C#+ARCGIS ENGINE开发查找地图元素并高亮显示代码1

(2008-12-13 13:02:12)

转载

标签:

分类: 程序源代码

杂谈

这是我帮同学做的一个简单的上机作业,本来是想做查找最短路径和查找地图元素(高亮

显示)两个功能的,只是查找最短路径的代码没有填进去,如果哪位朋友需要的话,可以发

邮件给我啊(wang_cuntao@)~~

下面是查找地图元素(高亮显示)的主要代码:

//

// Copyright 2006 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 use restrictions at /arcgis/developerkit/userestrictions.

using System;

using g;

using tions;

using entModel;

using ;

using ;

using ;

using ls;

using stem;

using UI;

using kAnalyst;

// This is the main form of the application.

namespace NAEngine

{

///

/// Summary description for Form1.

///

public class frmMain :

{

///

/// Required designer variable.

///

public IMapControl2 pMapControl;

private ner components = null;

private er splitter1;

private ox cmbLayers;

// Context menu objects for NAWindow's context menu

private tMenu contextMenu1;

private em miLoadLocations;

private em miClearLocations;

// ArcGIS Controls on the form

private ontrol axMapControl1;

private nseControl axLicenseControl1;

private barControl axToolbarControl1;

private ontrol axTOCControl1;

// Listen for context menu on NAWindow

private IEngineNAWindowEventsEx_OnContextMenuEventHandler m_onContextMenu;

// Reference to Network Analyst Environment

private IEngineNetworkAnalystEnvironment m_naEnv;

// Reference to NAWindow. Need to hold on to reference for events to work.

private IEngineNAWindow m_naWindow;

private MenuStrip menuStrip1;

private ToolStripMenuItem oPENToolStripMenuItem;

private Label label1;

private Label label2;

// Menu for our commands on the TOC context menu

private IToolbarMenu m_menuLayer;

public frmMain()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();

}

///

/// Clean up any resources being used.

///

protected override void Dispose(bool disposing)

{

wn();

if (disposing)

{