|
|
|
|
|
- Possible error cases:
- Key for the Google Maps service
GglAddressToCoordinates (Function) In french: GglAdresseVersCoordonnées Retrieves the coordinates (latitude/longitude) of an address. This function uses the Google Maps service. MaCléGoogle is string
MaCléGoogle = "Exemple de clé Google"
LocParis is gglCoordinate
LocParis = GglAddressToCoordinates(MaCléGoogle, "Paris, France")
LocHome is gglCoordinate
LocHome = GglAddressToCoordinates(MaCléGoogle, "3 rue Puech Villa, 34197 Montpellier")
MaCléGoogle is string
MaCléGoogle = "Exemple de clé Google"
MonZoom is int = 12
gglParamètres is gglMapParameter
Latitude, Longitude are reals
Localisation is gglCoordinate
M1 is gglMarker
Localisation = GglAddressToCoordinates(MaCléGoogle, "3 rue de puech villa 34000 Montpellier")
Latitude = Localisation.Latitude
Longitude = Localisation.Longitude
M1.Latitude = Latitude
M1.Longitude = Longitude
M1.Color = 0x0000FF
M1.Size = gglSmall
Add(gglParamètres.Marker, M1)
IMG_MAP = GglGetStaticMap(MaCléGoogle, Latitude, Longitude, Zoom, IMG_MAP.Largeur, ...
IMG_MAP.Hauteur, gglRoadmap, gglParamètres)
Syntax
Retrieving the address of a location while specifying the Google key Hide the details
<Result> = GglAddressToCoordinates(<Google key> , <Location>)
<Result>: gglCoordinate variable gglCoordinate variable containing the latitude and longitude of the requested address. <Google key>: Character string or Secret string Authentication key for the Google Maps service. This key is supplied by Google.
New in version 2025Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string". To learn more about secret strings and how to use the vault, see Secret string vault. <Location>: Character string Requested location (city name, country, full address, ...). | This syntax is obsolete since June 11th 2018. From now on, as the Google license has evolved, only the syntax using the Google key must be used. |
Retrieving the address of a location Hide the details
<Result> = GglAddressToCoordinates(<Location>)
<Result>: gglCoordinate variable gglCoordinate variable containing the latitude and longitude of the requested address. <Location>: Character string Requested location (city name, country, full address, ...). Remarks - The Internet connection is not valid.
- The server returns an error because the coordinates cannot be found.
To find out whether an error occurred, use the ErrorOccurred variable. Key for the Google Maps service To obtain the key needed to use the Google Maps service, connect to the Google API console: use the following address: https://developers.google.com/console. In the console: - Click "Create a project" if necessary. Give the name of your project. An identifier is automatically proposed for your project. Confirm. The project is created.
- In the menu on the left, click "API and authentication" then "API".
- Select the services required by the application: "Geocoding API" and "Places API".
- In the menu on the left, click "Identifiers".
- Then, click the "Create a key" button.
- Then, click "Server key".
- Finally, click the "Create" button.
- The key is created and can be used in GglAddressToCoordinates.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|