tComposant Delphi / Google Maps / CloudMade / OpenMapQuest / Leaflet  / Bing Maps
Google Maps
Google Earth
CloudMade
OpenMapQuest
LeafLet

EarthView

Property type EarthView TECMapEarthView allows you to manage the display 3D Google Earth

Available only with Google maps api

23

TECMapEarthView

It gives access to properties and methods

procedure Clear;
Clears KML
procedure EnableLayer(const sLayer:string;const bShow:boolean)

Toggle a layer

You can choose from

  • LAYER_BORDERS
  • LAYER_BUILDINGS
  • LAYER_BUILDINGS_LOW_RESOLUTION
  • LAYER_BUILDINGS_LOW_RESOLUTION.
  • LAYER_ROADS
  • LAYER_TERRAIN
  • LAYER_TREES
LAYER_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);
procedure Camera(const dLatitude,dLongitude:double)
Set the camera dLatitude, dLongitude and displays the view in accordance with the properties Altitude,Roll, Tilt and Heading
procedure LookAt(const dLatitude,dLongitude:double)
Look at the point in dLatitude, dLongitude and displays the view in accordance with the properties Altitude,Range, Tilt and Heading
function getGroundAltitude(const dLatitude,dLongitude:double):double;
Returns the height of the point in dLatitude,dLongitude
procedure LoadKml(const UrlKmlKmz:string);

Loading KML / KMZ remote

UrlKmlKmz url file to import

Data is added to the data already, do a Clear front if you want a complete replacement

46
procedure PlacemarkCamera(const id:integer)
Positions the camera on the mark of index id and displays the view consistent with the properties Altitude,Roll, Tilt et Heading
procedure PlacemarkLookAt(const id:integer)
Look at the mark of index id and displays the view consistent with the properties Altitude,Range, Tilt et Heading
procedure setPlacemarkLatLngAlt(const id:integer;const Lat,Lng,Alt:double);
Positioning mark id in Latitude, Longitude and Altitude
procedure getPlacemarkLatLngAlt(const id:integer;var Lat,Lng,Alt:double);
Obtain the latitude, longitude and altitude of the mark of index id
procedure FromXYToLatLngAlt (const iX, iY: double; var dLatitude, dLongitude, altitude: double)
Returns the Latitude, Longitude and Altitude of the point X,Y (pixels)
property Altitude : double

Property read / write to determine its altitude

property MouseAltitude : double

Property read only indicates the altitude of the point under the mouse cursor

property AltitudeMode: TAltitudeMode

Property read / write to fix the way is to calculate the altitude

You can select from

  • amAbsolute
  • amRelativeToGround
  • amClampToGround
  • amRelativeToSea
  • amClampToSea
property FlyToSpeed : double

Property read / write to set the speed from 0 to 5.0

Use 6.0 for an immediate téléportage

47
property Loaded : boolean
Read-only property to determine if the plugin has been loaded
property Latitude : double
Property read / write to determine latitude
property Longitude : double
Property read / write for determining longitude
property Heading : double
Property read / write to determine the orientation with respect to North (0 ° to 360 °)
property Tilt : double
Property read / write for determining the angle of sight (de 0° to 90° for LookAt and 0° to 180° for Camera)
property Range : double
Property read / write to determine the distance to the observed point (not used by Camera)
property Ready : boolean
Read-only property to determine when the plugin has finished rendering screen, corresponds to the event OnEarthViewFrameEnd
property Visible : boolean
Property read / write to toggle the 3D view
property Atmosphere : boolean
Property read / write or not to view the atmosphere
property Grid : boolean
Property read / write to display or not the lines of latitudes and longitudes on the globe
property MouseNavigationEnabled : boolean
Property read / write or not to activate the movement with the mouse

property NavigationControlVisibility : TNavigationControlVisibility

Property read / write or not to display controls, you can choose between ncvShow,ncvHide et ncvAuto

// Delphi map component ECMap

map.EarthView.NavigationControlVisibility := nvcAuto;

property StatusBar : boolean
Property read / write or not to display the information bar
property ScaleLegend : boolean
Property read / write or not to display scale
property Sun : boolean
Property read / write to display or not the sun
property OverviewMap : boolean
Property read / write or not to view a mini world map
property TerrainExaggeration : double
Property read / write which is a factor to increase the altitude of 1.0 to 3.0
property ToKml : string;

Property read / write that enables the import / export kml

TECMap toKml has the function to export almost all the overlays in KML

// Delphi map component ECMap

// import overlays (markers, rectangles, circles,...routes)
map.EarthView.toKml := map.toKml;

property ToTxt : string;
Property read / write which gives access to properties in a text format.

KML data are not taken into account

16
property PlaceMark[const index:integer]: string

Property read / write which determines the content of the brand index id

The chain is in KML, gender

<Placemark>
<name>Placemark from KML string</name>
<Point>
<coordinates>-122.448425,37.802907,0</coordinates>
</Point>
</Placemark>

property PlacemarkCount : integer
Returns the number of Placemark
property Models : TECMapEarthModels

List type models TECMapEarthModel

A model is defined by the tag Kml <Model>
property StreamPercent : integer
Read property that indicates the percentage loading of sight
property ApiVersion : string
Returns the version of the Google Earth API
property PluginVersion
Returns the version number of the 3D plugin

For the changes to the properties Altitude, Heading, Range, Tilt and Roll are visible you must trigger a call LookAt or Camera

17

TECMapEarthModels

This class has methods and properties

procedure LoadKml(const filename:string);
load a KML / KMZ defining a 3D model, triggers the event OnEarthViewUpdateModels

// 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

48
function IndexOf(const idModel:string):integer;
Returns the index of the model that we pass the ID

This is the ID property of the tag Model

49
procedure Delete(const index:integer);
Removes the index model
function Count:integer;
Returns the number of 3D model
procedure Clear;
Clears all the 3D models
property Model[Index:integer]:TECMapEarthModel

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

procedure setLatLngAlt(const Lat,Lng,Alt:double);
Position the model in latitude, longitude, altitude
procedure LookAt;
Watch model
property Id : string ;

Property read that gives the identifier of model

This is the ID property of the tag Model

50
property Index : integer
Index model in the list Models
property Latitude : double
Property read / write to determine latitude
property Longitude : double
Property read / write for determining longitude
property Heading : double
Property read / write to determine the orientation with respect to North (0 ° to 360 °)
property Tilt : double
Property read / write for determining the angle of view (0 ° to 90 °)
property Range : double
Property read / write to determine the distance to the observed point)
property Roll : double
Property read / write to determine the rotation model
property Altitude : double
Property read / write to determine the height of the model

Events



In addition to the events below you also have access to OnMapClick, OnMapDblClick, OnMouseMove, OnOverlayMouseDown, OnOverlayMouseUp et OnOverlayMouseOut

51

property OnEarthViewInit : TNotifyEvent;
Fired when the plugin is loaded, this happens when you switch to true TECMapEarthView.Visible
property OnEarthViewShow : TNotifyEvent;
Fired when when you switch to true TECMapEarthView.Visible
property OnEarthViewChange : TNotifyEvent;
Triggered when the view changes
property OnEarthViewFrameEnd : TNotifyEvent;
Triggered when 3D rendering is done, this is a good place to move 3D models for smooth animation
property OnEarthViewUpdateModels : TNotifyEvent;
Triggered by the addition of a model
property OnEarthViewUpdatePlacemarks : TNotifyEvent;
Triggered by the addition of a Placemark
property OnEarthViewClickPlacemark (sender: TObject;const index:integer;const KmlString:string)

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.
Fig. 43 EarthView in Demo3D
Fig. 43 EarthView in Demo3D

DemoOverlay the program shows you how to transfer data to a 3D view

Fig. 44 DemoOverlay
Fig. 44 DemoOverlay
Fig. 45 Import KML overlays
Fig. 45 Import KML overlays
go to page
© 2012 ESCOT-SEP Christophe - Made width Help&Web - RSS
Site Meter