Introduction to WPF & ArcGIS Engine 3D Development

Source: Internet
Author: User
Tags visual studio 2010
Http://kb.cnblogs.com/page/84640/author: Where is the thief? Source: blog site Release Date: Read: 391 Original article link full screen read [favorites]

A few days ago, during the ESRI Development competition, when I first came into contact with ArcGIS Engine (hereinafter referred to as AE), I had a lot of experiences and learned from the process, I would like to share this with you.

It is a three-dimensional underground campus pipeline system, using the AE scenecontrol component. Legend has it that scene is suitable for the presentation of fine models in small scenarios, and globe is suitable for the presentation of massive data in large scenarios. The interface uses dotnetbar for winform, but WPF is actually better. Here I also take WPF as an example.

My system environment: Windows 7 Professional Edition, Visual Studio 2010, ArcGIS Engine 9.3

1. Create a project

Create a WPF project,Must select. NET Framework 3.5(Ae9.3 does not support. net4.0). Add reference:

ESRI. arcgis.3danalyst
ESRI. ArcGIS. axcontrols
ESRI. ArcGIS. Carto
ESRI. ArcGIS. Controls
ESRI. ArcGIS. Display
ESRI. ArcGIS. Geometry
ESRI. ArcGIS. globecore
ESRI. ArcGIS. Output
ESRI. ArcGIS. System
ESRI. ArcGIS. systemui

Vs08 can find all references under the. NET tab, but 10 can only be found under the ESRI installation directory

2. Interface

Remove the default mainwindow, split the grid in the main form into the left and right parts, and place a windowsformshost on both sides to carry the AE control.

Open the XAML view,
Introduce the namespace of the AE control at the top.

Xmlns:ESRI= "CLR-namespace: ESRI. ArcGIS. controls; Assembly = ESRI. ArcGIS. axcontrols"

Edit two windowsformshost and add two controls

< Windowsformshost Margin = "10">
< ESRI : Axtoccontrol X : Name = "TOC" Dock = "Fill"/>
</ Windowsformshost >

< Windowsformshost Grid. Column = "1" Margin = "10">
< ESRI : Axscenecontrol X : Name = "Scene" Dock = "Fill"/>
</ Windowsformshost >

3.Code
AE'sProgramLiscene is required to be started. A licensecontrol is usually placed on the form. However, this method does not work for WPF.
Create a constructor under app. XAML. CS and app

Public APP () { Aoinitialize Aoi = New Aoinitializeclass (); // Additional license choices can be encoded here. Esrilicenseproductcode Productcode = Esrilicenseproductcode . Esrilicenseproductcodeengine; If (AOI. isproductcodeavailable (productcode) = Esrilicensestatus . Esrilicenseavailable) { Aoi. initialize (productcode ); } }

After the program starts, bind TOC to scene and load the map

Private Void Window_loaded ( Object Sender, Routedeventargs E) { This . Toc. setbuddycontrol ( This . Scene ); // Bind TOC To Scene This . Scene. loadsxfile ( "******" ); // Loading scenario This . Scene. navigate = True ; // Enable Navigate This . Scene. Update (); }

OK. Start F5 and check the effect.

Finally, if you have installed 64-bit windows, perform the following steps: Project-> wpfscene properties-> GenerateSet the target platform to x86. Only because AE does not support 64-bit data, we are disappointed that the latest ArcGIS 10 still does not.

Refer:

Is WPF and arcengine quite emotional?

How to Use arcengine controls for development in the WPF Project

ArcGIS blog: Can you use Visual Studio 2010 to develop against ArcGIS 10

ESRI Resource Center: How to host an ArcGIS Engine map control in a WPF Application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.