Composant Delphi / Google Maps / CloudMade / OpenMapQuest / Leaflet  / Bing Maps

InfoWindow

you are here :TECMap > Overlays

A InfoWindow is a bubble of information that can contain HTML text, they are accessible through the list InfoWindow type TECMapInfoWindows

Fig. 32 A InfoWindow associated with a circle
Fig. 32 A InfoWindow associated with a circle

TECMapInfoWindows

This class has methods and properties


function Add(sContent:string):integer;
Adds InfoWindow

content can be plain text or HTML

29
procedure Clear;
Clears all InfoWindow
procedure Delete(index:integer);
Deletes InfoWindow which we pass the index
property Count:integer;
Returns the number of marker in the list
property InfoWindow[index:integer]:TECMapInfoWindow;
Table that allows access to InfoWindow is the default property so you can access it directly by map.InfoWindows[index] instead of map.InfoWindows.InfoWindow[index]
property ToKml : string;
Read-only property that returns a string in kml format listing the infowindows
property ToTxt : string;
Property read / write which gives access to the list in text format InfoWindow.

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

30

TECMapInfoWindow

The InfoWindow have methods and properties

procedure setPosition(const dLatitude,dLongitude:double);

Moves InfoWindow in Latitude, Longitude

Not available CloudMade

9
property Anchor : integer;
Property read / written InfoWindow combines to a marker

Under the CloudMade InfoWindow must necessarily be associated with a marker to be displayed

10
property Content : string;
Property read / written defining the content of InfoWindow
property Latitude : double;

Property read / written with access to the latitude

Not available CloudMade

10
property Longitude: double;

Property read / written with access to the longitude

Not available CloudMade

11
property MaxWidth : integer;

Property read / written to define the maximum width that can reach InfoWindow

Not available CloudMade

12
property Open : boolean

Property read / written to open / close a InfoWindow

The closure of a InfoWindow triggering event OnCloseInfoWindow

property Zindex : integer;
Property read / written, attribute a priority index for displaying the InfoWindow a InfoWindow with a zIndex higher will be displayed on top of a lower zIndex
property Index : integer;
Index InfoWindow in its list
property ToKml : string;
Read-only property that returns a string in kml format containing InfoWindow
property ToTxt : string;
Property read / write which gives access to InfoWindow in a text format.

OnCloseInfoWindow

Event triggered the closure of a InfoWindow

procedure OnCloseInfoWindow(sender: Tobject;const Index:integer)

Index index in the list InfoWindow InfoWindow

Difference between API

Under CloudMade to be displayed a InfoWindow must be associated with a marker

// Delphi map component ECMap

// create marker on center of map
id_marker := map.AddMarker(map.Latitude,map.longitude);
// create infowindow
id_info := map.InfoWindows.Add('InfoWindow 1');
// link infowindow width marker
map.InfoWindows[id_info].Anchor := id_marker;
// open infowindow - good in CloudMage and Google
map.InfoWindows[id_info].open := true;
// create infowindow
id_info_2 := map.InfoWindows.Add('InfoWindow 2');
// fix position
map.InfoWindows[id_info2].setPosition(48,0.7);
// open - Google ok, but don't open on CloudMade
map.InfoWindows[id_info2].open := true;


While in Google Maps you can directly open a InfoWindow without associating it with a marker

go to page
© 2011-2013 ESCOT-SEP Christophe - Made width Help&Web - RSS
Site Meter