It is possible to trace a path with the function gglrecupèreCarte. This requires using all the parameters of the function. Some difficulties may be encountered, see tips below on this article.
must determine the various parameters relating to the structure gglParamètreCarte. In addition it must be determined a marker if you use the auto zoom (the area does not work contrary to the error message displayed if no marker is set) Here I used a table structure for the different boundary points. This allowed to use [] for filling the dynamic array. The
FOR ANY ELEMENT is very convenient to the route table.
Notice also the use of the Add function to add an item to a table. We could also use the TableauAjoute.
Here is the code used when clicking on the button:
point is a structure
lat is a real
longitude is a real
END
cléGoogle is a string = "VotreClé"
Path is a gglParamètreCarte
stUnPoint is a point
sCoord is gglCoordonnée
tabCoord is a 0 points table
Journey is a gglChemin
UnMarq is gglMarqueur
/ / set the stroke
Chemin.Chemin .. Color = iRougeFoncé
Chemin.Chemin .. Thickness = 2
Chemin.Chemin .. Opacity = 100
/ / Set table item
tabCoord = [[40.7078, -74.0021], [46.7140, -56.3968], [51.0165, -29.5967], [51.1067, -25.1016],
[49.8997, -6.1730] [48.9577,2.1423]]
/ / set points in the plot
FOR ANY MEMBER OF stUnPoint tabCoord
sCoord.Latitude = stUnPoint.lat
sCoord.Longitude = stUnPoint.longi
Adds (Chemin.Chemin .. Point sCoord)
END
Chemin.Format = gglJPG
/ / when you put a photo car must specify an area or a marker
/ / but not work with a zone, so we put a marker
/ / = 40.7078 chemin.Zone.Latitude
/ / chemin.zone.Longitude = -74.0021
/ / set the marker
UnMarq.Latitude = 40.7078
UnMarq.Longitude = -74.0021
UnMarq.Taille = gglPetit
Adds (Chemin.Marqueur, UnMarq)
IMG_Image1 GglRécupèreCarte = (cléGoogle, 40.7078,3.9483, gglZoomAuto, 600.400, gglHybride, Path)
CASE ERROR: Error
(ErreurInfo (errComplet))
TRICKS:
When Google does not return the card, there is no error message, nothing happens. So if when clicking on the button, you immediately hand over the application, then you have too many points.
Beware the number of track point. Indeed it is limited to 100 points, except that it decreases if you put markers. So if the map does not show is that you exceed the number of points. In my tests through 7 markers, I could put 70 points in that path.
Where error is the automatic handling of errors, needless to appeal directly to you 'll get an error. You must click on the link "If error per program" the pcode for the "case" error.
Warning:
If you use the syntax .. Chemin.Chemin Point, you can not use the Add function, it will write Chemin.Chemin.point. (Report to ST)
You can not use [] to fill a table structure if you declared your table: tab is a dynamic array of 0 gglCoordonnées (report to ST).
Because of that and in the code there is a declaration of a structure "Point".
0 comments:
Post a Comment