|
|
|
|
- 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 is using the Google Maps service. MyGoogleKey is string MyGoogleKey = "Google key example" ParisLoc is gglCoordinate ParisLoc = GglAddressToCoordinates(MyGoogleKey, "Paris, France") HomeLoc is gglCoordinate HomeLoc = GglAddressToCoordinates(MyGoogleKey, "3 rue Puech Villa, 34197 Montpellier")
MyGoogleKey is string MyGoogleKey = "Google key example"  // Display a map from a physical address MyZoom is int = 12 gglParameters is gglMapParameter Latitude, Longitude are reals Location is gglCoordinate M1 is gglMarker  // Retrieve the longitude and latitude of a physical address Location = GglAddressToCoordinates(MyGoogleKey, "3 rue Puech Villa 34000 Montpellier") Latitude = Location.Latitude Longitude = Location.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(MyGoogleKey, Latitude, Longitude, Zoom, IMG_MAP.Width, ... IMG_MAP.Height, gglRoadmap, gglParameters)
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 Authentication key for the Google Maps service. This key is supplied by Google. <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 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: - 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.
- In the menu on the left, click "API and authentication" then "API".
- Choose 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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|