Quick Start to itelluro development on 3D GIS

Source: Internet
Author: User

This Quick StartStep by stepTo describe how to create a simple 3D application.Itelluro globeengineUse of 3D controls.

TheCodeSeeSDK"Example\Quick Start "directory.

 

Follow these steps to prepare for development.

(1) StartVisual Studio, Create a new projectWinformProject;

(2) Create a folder under the project, suchLibSDKProgramUnder the package folderDLLFile andLicCopy the file to this folder and copy it to the project.DebugOrReleaseUnder the folder (It is very important to copy all files at the same time.);

(3) Copy"Itelluro. globeengine. ini"To projectDebugOrReleaseIn the folder, follow the instructions in the Appendix to modify its content so that its path points to the relevant data in the sample data;

(4) Reference in the projectLib"Itelluro. globeengine. mapcontrol3d. dll". VariousDLLFor more information about functions and contained controls, interfaces, and classes, see the next chapter.

(5) ModifyVisual StudioOfLoaderlock:

Select debug
-
Exception. The following dialog box is displayed:

DeselectLoaderlock, And click OK.

(6) Load controls

Define 3D view controlsGlobeview:

 
Globeview _ globeview;

Create and load:

 

 
// 3D control loading _ globeview = new globeview (); _ globeview. Dock = dockstyle. Fill; this. Controls. Add (_ globeview );

 

 

ClickF5Run to run.

System visualization controls cannot be added in design mode. Please add them in code mode.

(7) Positioning 3D view

Click the create button to add the positioning code to the event:

 
// Locate Qinghai lake. The camera height is 150km_globeview.globecamera.flyto (100.2167, 36.8667, 150000.0 );

Locate and useGlobecameraObject, callFlytoMethod To achieve flight positioning.

(8) Add a layer control.

Create a layer control, andGlobeviewControl binding:

 
// Create a layer control globelayercontrol lyrui = new globelayercontrol (); lyrui. dock = dockstyle. fill; this. panellayer. controls. add (lyrui); // bind the layer control to the 3D view lyrui. connect (_ globeview );

(9) Mouse event

Define Mouse clicking and moving events:

 
// Move the cursor to Event _ globeview. globemousemove + = new move (_ globeview_globemousemove); // Click Event _ globeview. globemouseclick + = new globemouseclickeventhandler (_ globeview_globemouseclick );

Create Event code:

 

The Code is as follows:

Void _ globeview_globemouseclick (Object sender, globemouseeventargs e) {MessageBox. show ("mouse position: \ n" + E. longpolling. tostring ("F5") + "," + E. latitude. tostring ("F5");} void _ globeview_globemousemove (Object sender, globemouseeventargs e) {This. lblmpos. TEXT = E. longpolling. tostring ("F5") + "\ n" + E. latitude. tostring ("F5 ");}

(10) AddPoiPoint Data

Creating layers and data needs to be referenced"Itelluro. globeengine. datasource. dll".

First, create the required layer object and vertex dataIDCounter:

Iconlayer_ Iconlyr;

Long_ Iconid=
0;

Create a layer object in the constructor and add itGlobeview:

//CreatePoiiconLayer

_ Iconlyr=
New
Iconlayer("Click position");

 

//AddGlobeviewWidget

_ Globeview.Globelayers.Floatlayers.Add (_ iconlyr );

Add in the mouse click eventPoiiconObject:

//CreatePoiiconObject

PoiiconIcon=
New
Poiicon(

_ Iconid++,

"Click position"
+_ Iconid.Tostring (),

E.Latitude,

E.Longpolling

);

//Set its icon file

Icon.Iconfile=
Path.Combine (Application.Startuppath,"Poi.png");

 

//Add to Layer

_ Iconlyr.Add (icon );

(11) CreatePoiiconClick to select an event for the icon layer, and delete the icon after selection.

When adding an icon, you need to set the icon to respond to the mouse click event:

//Set icons to respond to events

Icon.Clickable=
True;

Set the icon layer selection event:

//Click Event

_ Iconlyr.Poiiconclicked+ =

New
Poiiconclickedeventhandler(_ Iconlyr_poiiconclicked );

Click the icon to delete the event:

Void_ Iconlyr_poiiconclicked (ObjectSender,PoiiconclickeventargsE)

{

If(E.Icon! =
Null)

{

_ Iconlyr.Remove (E.Icon );

}

}

 

Shows the system running effect:

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.