EarthView type TECMapEarthView property lets you manage 3D Google Earth display or cesium
Google Earth is available only with the api Google
25The Google Earth plugin will be abandoned by Google in December 2015
26The suite TECMap offers independent component TECCesiumMap to manage your views 3D, this component is also integrated with EarthView to replace Google Earth.
The integration of Cesium in EarthView is partial, the logo indicates compatibility with Cesium
It is recommended to use directly the Cesium property which gives full access to the Component Manager Cesium.
3TECMapEarthView
It gives access to the following methods and properties
Clears data
data are erased only in the 3D view, they are always available in the standard 2D view
16Enable/disable layer
You can choose amongst
- LAYER_BORDERS
- LAYER_BUILDINGS
- LAYER_BUILDINGS_LOW_RESOLUTION
- LAYER_BUILDINGS_LOW_RESOLUTION.
- LAYER_ROADS
- LAYER_TERRAIN
- LAYER_TREES
Under Cesium only LAYER_TERRAIN is functional
17LAYER_TERRAIN is enabled by default
//
Delphi map component ECMap
// active LAYER_BUILDINGS
and LAYER_TREES
map.EarthView.EnableLayer('LAYER_BUILDINGS',true);
map.EarthView.EnableLayer('LAYER_TREES',true);
Loading a remote Kml/Kmz file (for Cesium only Kml)
UrlKmlKmz URL of the file to import
The data is added , made a Clear front if you want a total replacement
50Read/write property to determine its altitude
Read/write property to fix how is calculated the altitude
You have the choice between
- amAbsolute
- amRelativeToGround
- amClampToGround
- amRelativeToSea
- amClampToSea
property Loaded : boolean
property NavigationControlVisibility : TNavigationControlVisibility
Read/write for display or non-property controls, you have the choice between ncvShow,ncvHide and ncvAuto
//
Delphi map component ECMap
map.EarthView.NavigationControlVisibility :=
nvcAuto;
Property read/write which allows import/export Kml format
TECMap has the toKml function to export almost all of the overlays in Kml format
//
Delphi map component ECMap
// import overlays
(markers, rectangles,
circles,...routes)
map.EarthView.toKml := map.toKml;
Google Earth under the given Kml are not taken into account
18Property read/write that determines the content of the index id mark
The string is in Kml format, such
<Placemark><name>Placemark from KML string</name>
<Point>
<coordinates>-122.448425,37.802907,0</coordinates>
</Point>
</Placemark>
List of TECMapEarthModel type models
A pattern is defined by the Kml tag <Model>List of 3D models of type TECCesiumShapeModel
To make changes to the Altitude, Heading, Range, Roll and Tilt properties visible you need to trigger a call to LookAt or Camera
19TECMapEarthModels
This class has methods and properties
//
Delphi map component ECMap
// load 3d
model
map.EarthView.models.LoadKml('http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/smart.kmz');
If templates are present in the KML loaded by TECMapEarthView.ToKml or TECMapEarthView.LoadKml they will also be available in the Models list
52procedure Delete(const index:integer);
Table for access types, the default property so you can access it directly by map.EarthView.Models[index] instead of map.EarthView.Models.Model[index]
TECMapEarthModel
Class manages a 3D model, it have methods and properties
property Index : integer
Guided tour
Google Earth allows you to play tours ( see la documentation de google earth api )
EarthView offers you the possibility to manage in a simple way.
property Tour : stringRead/write property to load a tour
- You can load a kml/kmz file from the internet or locally
- You can also pass a string containing the kml data
// load kml tour
map.EarthView.Tour := 'http://www.my.com/mytour.kml';
map.EarthView.Tour := 'c:\mytour.kml';
map.EarthView.Tour := '<?xml version="1.0"
encoding="UTF-8"?>...<gx:Tour>...';
The OnLoadTour event is raised when the tour is loaded and available
55procedure PauseTour;
Events
In addition to the events below you also have access to OnMapClick, OnMapDblClick, OnMouseMove, OnOverlayMouseDown, OnOverlayMouseUp et OnOverlayMouseOut
57property OnEarthViewInit : TNotifyEvent;
Triggered by a click on a Placemark
index is the index of the mark in the list Placemark
KmlString the content of the mark in KML, gender
<Placemark>
<name>Placemark from KML
string</name>
<Point>
<coordinates>-122.448425,37.802907,0</coordinates>
</Point>
</Placemark>
Demonstrations
Demo3D shows you how to move a particular 3D model by following a specific route.DemoOverlay the program shows you how to transfer data to a 3D view