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

Layers

you are here :Overlays

BicyclingLayer

Shows bike paths only available with api Google

// Delphi map component ECMap

// show bicyclinglayer
map.BicyclingLayer := true;

Fig. 35 BicyclingLayer

For the moment the layer is not particularly well developed in Europe, you can replace it with a card that OpenMapStreet CycleMap to the advantage of operating under all apis.

// Delphi map component ECMap

// change map type to CycleMap
map.MapTypeId := mtCYCLEMAP;

Fig. 36 OpenMapStreet CycleMap

TrafficLayer

Displays the status of traffic does not seem enabled on all regions, only available with api Google

// Delphi map component ECMap

// show Trafficlayer
map.TrafficLayer := true;

Fig. 37 TrafficLayer

TrafficArea

The procedure TrafficArea(const dLatSW,dLngSW,dLatNE,dLngNE:double) determines the incidents taking place in a given area.

You must you connect on the OnTraffic of component event to use the response

// Delphi map component ECMap

// see incident on area show by map
map.TrafficArea(map.SouthWestLatitude,map.SouthWestLongitude,map.NorthEastLatitude,map.NorthEastLongitude);


// event OnTraffic
procedure TFormDemoECMap.mapTraffic(sender: TObject; const XmlResponse,
TxtMapMarkers: string);
begin
// use XmlResponse for details

// show on map
map.Groups['traffic'].ItemsToTxt := TxtMapMarkers;
map.Groups['traffic'].Show;
end;

Properties TrafficIconLowImpact, TrafficIconMinor, TrafficIconModerate, TrafficIconSerious and TrafficIconRoadClosed allow you to use your own icons.

Fig. 38 Show TrafficArea

TrafficArea uses services from Bing Traffic, you need to get your own key Bing to use this feature.

FusionTablesLayer

Displays data from a table Google Fusion only available with api Google

You manage your layers FusionTablesLayers through the property type TECMapFusionTablesLayers

// Delphi map component ECMap

// add un fusiontableslayer
id := map.FusionTablesLayers.Add('Geocodable address','139529','','');
map.FusionTablesLayers[id].visible := true;

TECMapFusionTablesLayers

See the documentation on google FusionTablesLayer
function Add(const Column,Id,Style,Clause:string):integer;

Adds a layer and returns its index

Column is the column of the table corresponds to select the google doc

Id is the identifier of the table is from in the google doc

Style the style is applied to layer

Clause is the SQL query that lets you filter your data is WHERE in the google doc

procedure Clear;
Clears all layers
function Count:integer;
Returns the number of layers
procedure Delete(index:integer);
Removes the layer which we pass the index
property FusionTablesLayer[index:integer]: TECMapFusionTablesLayer
Table that allows access to layers, it is the default property so you can access it directly by map.FusionTablesLayers [index] instead of map.FusionTablesLayers.FusionTablesLayer [index]
property ToTxt: string ;
Property read / write which gives access to the list in text format FusionTablesLayer.

In writing there is an addition and not a replacement, if you do not want to keep the old values before making a Clear adding

40

TECMapFusionTablesLayer

Controlling a class FusionTablesLayer

procedure update;
Update properties, you must call to reflect the changes in properties
property TableId : string

identifier of the table is from in the google doc

property LocationColumn : string

column of the table corresponds to select in the google doc

property Clause : string

SQL query that lets you filter your data, corresponds to Where in google doc

property Style : string

applicable to the layer style

property Heat : boolean

corresponds to heatmap in the google doc

property SuppressInfoWindow : boolean

Enable or not displaying a InfoWindow when clicking on an element of layer

property Visible : boolean

Displays whether the layer

property ToTxt : string
Property read / write accesses the layer in a text format.

OnFusionTablesLayerClick

TECMap has an event to intercept a click on an element of layer.

procedure OnFusionTablesLayerClick (sender: TObject;const idLayer:integer;const htmlInfoWindow:string;dLatitude,dLongitude:double);
idLayer number of layer in the list FusionTablesLayers
htmlInfoWindow a string containing the HTML content of the tooltip of the item, if available
dLatitude,dLongitude coordinates of the point clicked

KmlLayer

You can import KML / KMZ into your cards and display overlay, not available with Leaflet.

KMZ files are not supported by CloudMade by cons GeoXml it supports the format (extension. Xml)

13
Layers Kml have properties and methods
Id : integer
Index layer, read-only
Url : string
Url kml file, read-only
Visible : boolean
Layer of visibility, read / write
ToTxt : string
property read / write to export / import format text all the elements
procedure Show;
Displays the default zone of the layer if it was specified

OnKmlLayerClick

TECMap has an event to intercept a click on an element of layer.

CloudMade not responding to this event

14
procedure OnKmlLayerClick (sender: TObject;const idKmlLayer:integer;const htmlDescription,htmlInfoWindow:string;dLatitude,dLongitude:double);
idKmlLayer number of layer in the list KmlLayers
htmlDescription a string containing the HTML content of the element, if there
htmlInfoWindow a string containing the HTML content of the tooltip of the item, if available
dLatitude,dLongitude coordinates of the point clicked

// Delphi map component ECMap
// add KML file M1+ Real-Time Earthquakes, Past 7 Days
id := map.KmlLayers.add(
'http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-age.kmz'
);
// show all
map.KmlLayers[id].show;

TECMap exports the majority of its data, including kml layers, in KML.

41

// Delphi map component ECMap

// export map data to kml string
kml_string := map.ToKml;

WeatherLayer

Available only with the Google api

15

// Delphi map component ECMap

map.WeatherLayer := true;

Fig. 39 WeatherLayer

OnWeatherLayerClick

TECMap has an event to intercept a click on an element of layer.

procedure OnWeatherLayerClick (sender: TObject;const htmlInfoWindow:string;dLatitude,dLongitude:double);
htmlInfoWindow a string containing the HTML content of the tooltip of the item, if available
dLatitude,dLongitude coordinates of the point clicked

DemoLayer


DemoLayer program allows you to see how to use these different layers and Panoramio , which is also a layer


Fig. 40 DemoLayer
Fig. 40 DemoLayer
go to page
© 2012 ESCOT-SEP Christophe - Made width Help&Web - RSS
Site Meter