- ECMap
- Purchase - Contact
- Use License
- Installation
- Positioning
- Card Type
- Controls
- Location
- Places
- Import / Export
- Overlays
- Groups
- StreetView
- EarthView
- Panoramio
- DistanceMatrix
- TECMapAdressEdit
- TECStaticMap
- Programming
- Table of Figures
- Glossary
Property type DistanceMatrix TECDistanceMatrix gives you the distance and travel time for each pair of addresses start / finish.
Not available on CloudMade
24The demonstration program DemoMatrix is an adaptation in Delphi of the example of google javascript
The example of Google not working in IE because there is a comma at the end arrays origins and destinations that crashes the IE javascript engine
25TECDistanceMatrix
Provides access to properties and methods
function Count:integer;
OnDistanceMatrix event is triggered when the calculation is finished
indexDestination is the index of the arrival point from the list Destinations
indexOrigine is the index of the starting point in the list Origins
Returns nil if the indices are out of bounds
18//
Delphi map component ECMap
map.DistanceMatrix.origins.clear;
map.DistanceMatrix.destinations.clear;
// origins
map.DistanceMatrix.origins.add('Tarbes');
map.origins.add('Lourdes');
// destinations
map.DistanceMatrix.destination.add('Aureilhan');
map.DistanceMatrix.destination.add('Séméac');
// calcul - fire
OnDistanceMatrice
Map.DistanceMatrix.Update;
...
// event fired when matrix is
ok, call by map.DistanceMatrix.Update
procedure
TFormDemoMatrix.mapDistanceMatrix(Sender:
TObject);
begin
if
map.DistanceMatrix.count=0 then
exit;
//
Tarbes/Aureilhan
map.DistanceMatrix[0,0].distanceText;
// Tarbes/Séméac
map.DistanceMatrix[0,1].distanceText;
//
Lourdes/Aureilan
map.DistanceMatrix[1,0].distanceText;
// Lourdes/Séméac
map.DistanceMatrix[1,1].distanceText;
end;
Item allows you to get your data sequentially, use Count to know the total number of pairs.
They are arranged in the following order
(Start1-Finish1), (Start1-Finish2),...,(Start2-Finish1),(Start2-Finish2),...
Returns nil if the index is out of bounds
19TECDistanceMatrixItem
This class represents a couple Departure / Arrival, it gives you access to properties
OnDistanceMatrix
Event triggered after the call to DistanceMatrix.Update when results are available