PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Possible error cases:
  • Key for the Google Maps service
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Retrieves the coordinates (latitude/longitude) of an address. This function is using the Google Maps service.
Example
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"
 
// Affichage d'une carte à partir d'une adresse physique
MonZoom is int = 12
gglParamètres is gglMapParameter
Latitude, Longitude are reals
Localisation is gglCoordinate
M1 is gglMarker
 
// Récupération de la longitude et latitude d'une adresse physique
Localisation = GglAddressToCoordinates(MaCléGoogle, "3 rue de puech villa 34000 Montpellier")
Latitude = Localisation.Latitude
Longitude = Localisation.Longitude
 
// Création du marqueur pour cette adresse
M1.Latitude = Latitude
M1.Longitude = Longitude
M1.Color = 0x0000FF
M1.Size = gglSmall
Add(gglParamètres.Marker, M1)
 
// Affichage de l'adresse dans un champ Image
IMG_MAP = GglGetStaticMap(MaCléGoogle, Latitude, Longitude, Zoom, IMG_MAP.Largeur, ...
IMG_MAP.Hauteur, gglRoadmap, gglParamètres)
Syntax
This syntax is obsolete from version 2 of the mapping service: the Google key is not required anymore.

Retrieving the address of a location while specifying the Google key Hide the details

<Result> = GglAddressToCoordinates(<Google key> , <Localization>)
<Result>: gglCoordinate variable
gglCoordinate variable containing the latitude and longitude of the requested address.
<Google key>: Character string
Authentication key for the Google Maps service. This key is supplied by Google.
<Localization>: 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(<Localization>)
<Result>: gglCoordinate variable
gglCoordinate variable containing the latitude and longitude of the requested address.
<Localization>: Character string
Requested location (city name, country, full address, ...).
Remarks

Possible error cases:

  • 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

The Google key is no longer required from version 2 of the mapping service.
To get the key required for using the Google Maps service, go to the following address:
Caution: the address of this page may have been modified since the publication date of this page.
To get the key required for using the Google Maps service, connect to the Google API console: use the following address: https://developers.google.com/console.
In the console:
  1. Click "Create a project" if necessary. Give the name of your project. An identifier is automatically proposed for your project. Validate. The project is created.
  2. In the menu on the left, click "API and authentication" then "API".
  3. Choose the services required by the application: "Geocoding API" and "Places API".
  4. In the menu on the left, click "Identifiers".
  5. Then, click the "Create a key" button.
  6. Then, click "Server key".
  7. Finally, click the "Create" button.
  8. The key is created and can be used in function GglAddressToCoordinates.
Business / UI classification: Business Logic
Component: wd270ggl.dll
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment