Difficulties and skills in Secondary Development of googleearth

Source: Internet
Author: User
  • 1. Basic Steps
  • 1. Install the googleearth Program
  • 2. register the activearth activexcontrol (googleearth.exe/regserver)
  • 3. Reference googleearth ActiveX in the Development Environment
  • Ii. Development Methods
  • There are two methods for development of GE, one is based on GE's com api, and the other is based on kml. The com api-based development method is mainly used to control GE's perspective and achieve animation effects. The kml-based development method is mainly used to generate geographical elements and achieve dynamic data updates. In practical applications, we need to combine these two development methods to achieve better results.
  • 1. comapi-based development
  • The API released by GE is currently in version 1.0a, with a relatively small number of functions and few functions available. In actual development, it is mainly used to load kml data, control the angle of view, and implement animation playback.
  • A. Load kml data
  • Iapplicationge. openkmlfile (kmlfilepath), load the specified kml file to ge;
  • Iapplicationge. loadkmldata (kmldata), load kml text to ge
  • B. control perspective
  • Iapplicationge. setcamera (icamerainfoge, double). Set the current perspective of GE. The first parameter is the angle of view parameter, and the second parameter is the speed at which the current angle of view flies to the angle of view (value range: 0-5 );
  • Iapplicationge. setfeatureview (ifeaturege, double): from the current perspective to the perspective of the specified element. The first parameter is the specified element. The perspective of this element is determined by the <lookat> label in kml, the second parameter is the flight speed (value range: 0-5 ).
  • C. animation effect
  • There are two ways to achieve the animation effect in GE. The first method is to implement the animation effect through the <annimation> label in kml. The label is placed inside the view represented by each frame, the second method is to use APIs to implement switching of views of all child elements under a parent element.
  • Itimeintervalge. Play () starts playing the frame in the <annimation> tag
  • Itourcontrollerge. playorpause () to play a child element under a parent element, or to pause playing
  • 2. kml-based development
  • GE is actually a browser. The browsed data is kml. kml is similar to the standard of vector graphics such as GML and SVG, But it describes the three-dimensional data structure, kml is considered a 3D vector graphics standard based on XML.
  • The structure of kml can be referred to (http://code.google.com/apis/kml/documentation/kml_tags_beta1.html). From its structure, it can be seen that the method of kml to describe the ground is similar to that of common GIS, it consists of elements, styles, perspectives, and animations. The following describes several difficult technologies in kml.
  • A. Cutting Technology
  • The level of detail technology allows you to view massive image map data on a PC. If you have experience using the GIS platform, you can set a layer to be displayed within a certain scale. If it is smaller than or beyond this range, it will not be displayed. For example, when the angle of view is very large, I only load image data of 1: W. When the angle of view is very small, I only load data, in this case, the lower the angle of view, the more detailed the features we can see.
  • In kml, the <region> label is used to implement the DLE technology. This label defines the range in which elements are displayed within the pixel range.
  • B. Dynamic Data Update Technology
  • In the GPS Vehicle Monitoring System, real-time data must be updated. The <networklink> and <refreshmode> labels in kml can be used to update data in real time. Set refreshmode to oninterval mode, and set the interval in <refreshinterval>. ge refresh the link address in the
  • C. animation Playback Technology
  • The <timespan> or <timestamp> label in kml is used to control animation playback. <timespan> or <timestamp> must be included in one element tag, it indicates that at a certain time point, GE's view is transferred to the view specified by the current element label, and corresponding actions are completed. Therefore, each element tag that contains a timestamp tag represents a frame in the animation process. (You can refer to trackreplay. kml to understand)
  • D. 3D Modeling Technology
  • The geometric objects in kml contain three attributes: longpolling, latitude, and altitude. The basic geometric figures (such as points, lines, and surfaces) are used together with the elevation data, we can build some simple 3D images. To build complex 3D models, you can use 3D modeling tools such as 3D MAX, Google sketch, and AutoCAD to convert the obtained 3D models to the Dae format, in this way, you can directly call these 3D models in Ge (<getfeaturebyname (name) is used to obtain the element getfeaturebyhref (href) through the element name) get the element through the link address (the content represented in the link address is obtained)

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.