PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Retrieves the coordinates (latitude/longitude) of an address. This function is using the Google Maps service.
Android Note: In the Android applications, use geoGetAddress.
Example
ParisLoc is gglCoordinate
ParisLoc = GglAddressToCoordinates("Paris, France")
HomeLoc is gglCoordinate
HomeLoc = GglAddressToCoordinates("3 rue Puech Villa, 34197 Montpellier")
// Display a map from a physical address
MyZoom is int = 12
gglParameters is gglMapParameter
Latitude, Longitude are reals
Localization is gglCoordinate
M1 is gglMarker

// Retrieve the longitude and latitude of a physical address
Localization = GglAddressToCoordinates("3 rue Puech Villa 34000 Montpellier")
Latitude = Localization..Latitude
Longitude = Localization..Longitude

// Create the marker for this address
M1..Latitude = Latitude
M1..Longitude = Longitude
M1..Color = 0x0000FF
M1..Size = gglSmall
Add(gglParameters..Marker, M1)

// Display the address in an Image control
IMG_MAP = GglGetStaticMap(Latitude, Longitude, Zoom, IMG_MAP..Width, ...
IMG_MAP..Height, gglRoadmap, gglParameters)
Syntax

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 (with quotes)
Requested location (city name, country, full address, ...).
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 (with quotes)
Authentication key for the Google Maps service. This key is supplied by Google.
<Localization>: Character string (with quotes)
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".
  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 it can be used in GglAddressToCoordinates.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230ggl.dll
Windows Mobile wp230ggl.dll
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment