- ECMap
- Purchase - Contact
- Use License
- Installation
- Positioning
- Card Type
- Controls
- Location
- Places
- Import / Export
-
Overlays
- Markers
- InfoWindow
- Labels
- Roads
- Layers
- Groups
- StreetView
- EarthView
- Panoramio
- DistanceMatrix
- TECMapAdressEdit
- TECStaticMap
- Programming
- Table of Figures
- Glossary
TECMapRoutes
This list has the following methods and properties :
const OptimizeWaypoints:boolean=false;const WayPoints:TLatLngList=nil):integer;
Adding a road, returns the index of the road in the list
Raises the event OnRouteChange on success otherwise OnRouteError
Name name of your road, can be empty
dStartLatitude,dStartLongitude starting point of the road
dEndLatitude, dEndLongitude endpoint of the road
OptimizeWayPoints force the calculation of the most direct route by reorganizing your crossings (has no action under CloudMade)
WayPoints list type TLatLngList of crossings.Pass nil if you do not specify a particular crossing points
32const OptimizeWaypoints:boolean=false;const WayPoints:TLatLngList=nil):integer;
Adding a road, returns the index of the road in the list
Raises the event OnRouteChange on success otherwise OnRouteError
Name name of your road, can be empty
sStartAdress Address of the starting point of the road
sEndAdress Address endpoint of the road
OptimizeWayPoints force the calculation of the most direct route by reorganizing your crossings (has no action under CloudMade)
WayPoints list type TLatLngList of crossings.Pass nil if you do not specify a particular crossing points
33AddByAdr is not available CloudMade
14You can undo changes in the last ten trip.
Not available CloudMade
15- tmBicycling
- tmDriving
- tmWalking
Not available CloudMade
16With the API CloudMade you can not change the points of departure / arrival and passages
11property Route[index:integer]:TECMapRoute; default;
// Delphi
map component ECMap
wp := TLatLngList.create(nil);
try
// add waypoint
wp.add(43.2237336276672,0.0462043685729441);
map.Routes.Color := clGreen;
id := map.Routes.Add('my first
route',
43.2328643,0.074120799999946,
43.0946324606031,-0.0254427986328665,true,
wp);
finally
wp.free;
end;
Events
idRoute is the index of the road in the list Routes
NewRoute equal True it is an addition to road, False if a rerouting
idRoute is the index of the road in the list Routes
sError explanation of the error
TECMapRoute
TECMapRoute is the class that handles a route, it gives you access to methods and properties :
Calculates the latitude and longitude of a point on the road according to its distance in meters, returns True if we found a point
SensStartEnd meaning of course, true for start -> finish
lMeter the distance in meters
dLatitude,dLongitude type variables double who will receive the latitude and longitude
idPoint a variable that will contain the index Path where is the point, the calculation returns an approximation, since your drive does not contain all the real points
The Polylines / Polygons have a single function through their property Path type TLatLngList
35Heading a variable to hold the angle of the point from the north ( 0 to 360°)
bEnd indicates whether it has exceeded or reaches the end of the road (or early depending on the direction)
procedure updateOptions;
Not available CloudMade
18property StartLatitude : double;
property EndLatitude : double;
- tmBicycling
- tmDriving
- tmWalking
With the API CloudMade you can not change the points of departure / arrival and passages
12Not available CloudMade
21TECMapRoutePath
List of points on the route, it gives you access to methods and properties
TECMapRoutePathPoint
Class manager point of the road, it gives you access to properties
AddPolylineFromRoute
TECMap has a feature that allows you to add a polyline from the index of a road
// Delphi map component
ECMap
// add polyline with info of
route number 0
id := map.AddPolylineFromRoute(0);
Cela peut-être utile pour "figer" une route, en effet lors de la sauvergarde d'une route seul les points de départ et d'arrivée sont sauvés, lors de la lecture un recalcul de la route sera effectué.
Polylines can calculate batch altitude points while for the roads it must be done step by step, DemoRoute uses AddPolylineFromRoute to calculate the elevation.
Utility functions
function TECMap.GetRoutePathFrom(const dLatLngs: array of double;const params): TECMapRoutePath;
procedure TECMap.GetASyncRoutePathFrom(const dLatLngs: array of double;const params: string);
function TECMap.GetRoutePathByAdress(const StartAdress, EndAdress: string;const params: string): TECMapRoutePath;
procedure TECMap.GetAsyncRoutePathByAdress(const StartAdress, EndAdress: string;const params: string);
These four routines to get a road without made of path information, you have two asynchronous procedures that will run in the background and raise the OnRoutePath event when the data are available.
If you do not release the TECMapRoutePath obtained, it will be automatically during the destruction of TECMap
37See open.mapquestapi.com/directions/ for the parameter Params
38You can create a polyline from a TECMapRoutePath
// ge data road between Tarbes and Lourdes via Aureilhan
routePath := map.GetRoutePathByAdress('Tarbes','Aureilhan|Lourdes');
// draw polyline from routePath
if routePath<>nil then
begin
id := map.polylines.addFromRoutePath(routePath);
// see the entire route
map.polylines[id].fitBounds;
routePath.free;
end;
Returns the distance in KM between two geographical points, uses the haversine formula
Returns the distance in KM between two addresses passing by road
Returns the distance in KM between two geographic points through the road
See open.mapquestapi.com/directions/ for the parameter Params of the functions DistanceRouteXXX
39Adds a route, Adresses contains the addresses of passages.
// find the distance in km by road between Tarbes and Lourdes via Aureilhan
dKm := map.DistanceRouteByAdress('Tarbes','Aureilhan|Lourdes');
Adresses := TStringList.create;
try
Adresses.add('Tarbes');
Adresses.add('Aureilhan');
Adresses.add('Séméac');
Adresses.add('Lourdes');
// create route Tarbes/Lourdes via Aureilhan and Séméac
map.AddRouteByAdress(Adresses);
finally
Adresses.free;
end;