ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Google functions / Managing Google Maps
  • Overview
  • How to?
  • Retrieving a map in your applications or in your sites
  • Retrieving a map with advanced setting (markets, ...)
  • Remark
  • Other services
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
Using the Google Maps service
Overview
The Google Maps service is an Internet mapping software proposed by Google. It is used to display a map by proposing several viewing features.
Remark: The cartography service proposed is Google Static Maps.
Examples of processes that can be performed in WLanguage:
  • Retrieving a map, displaying it in a window control or in a report control and sending it by email.
  • Defining the map area and the size of the image to retrieve by specifying the latitude, the longitude, the zoom factor, ...
  • Drawing an itinerary on the map (point by point): a path can be retrieved during a journey by a GPS that saves the itinerary.
  • Displaying markers on a map at a given position.
Warning: Before using a feature linked to Google services, we strongly recommend that you check the license for using this service. Some restrictions may apply. The content of the licenses may change over time.
PC SOFT is in no case responsible for the way the native access functions are used. Make sure that you comply with the license of the service provider.
How to?

Retrieving a map in your applications or in your sites

To include a map that uses the Google Maps service in your applications or in your sites:
  1. Generate a Google key. This key is supplied by Google. For more details, see https://developers.google.com/maps/documentation/javascript/tutorial#api_key. Caution: the address of this page may have been modified since the publication date of this page.
  2. Create an Image control in your WINDEV or WEBDEV project. This control will be used to display the requested map.
  3. In the code used to retrieve the map, assign the result of GglGetStaticMap to the Image control. This function expects the following parameters:
    • the Google key
    • the latitude and longitude of the central point of the map
    • the zoom performed
    • the size of image to retrieve. The maximum size is set to 640 x 640. This limit is defined by the Google Maps service at the date of publication of this page.
    • the type of requested map (road map, satellite, ...).
By default, this map has no border, it is in GIF format and it contains no marker. The language displayed on the map corresponds to the language of the country displayed.

Retrieving a map with advanced setting (markets, ...)

To include an advanced map that uses the Google Maps service in your applications or in your sites:
  1. Generate a Google key. This key is supplied by Google. For more details, see https://developers.google.com/maps/documentation/javascript/tutorial#api_key.
  2. Create an Image control in your WINDEV or WEBDEV project. This control will be used to display the requested map.
  3. In the code used to retrieve the map:
    • Create a variable of type gglMapParameter. This variable will be used to define all the characteristics of the map: presence of a border, display of a path, format of the image received, markers, ... Specify the requested characteristics only.
    • Assign the result of GglGetStaticMap to the Image control. In <Advanced Parameters>, specify the name of the gglMapParameter variable containing the requested options.
Remark: No image is returned if the limitations defined by Google are exceeded (number of points in a path, number of markers, size of the image, ...). In this case, we advise you to modify the parameters of the map by reducing the number of elements to display.
WINDEVWEBDEV - Server codeWindowsAjax

Remark

If you use a proxy to access Internet, the proxy must be configured (Proxy) to use Google functions.
Other services
WINDEVWEBDEV - Server codeWindows The Google Maps service can also be used to get the coordinates of an address. This feature can be used via GglAddressToCoordinates.
This function returns the latitude and longitude of the address specified in a gglCoordinate variable.
Related Examples:
The GglGetStaticMap function Unit examples (WINDEV): The GglGetStaticMap function
[ + ] Using gglGetMap to display a Google map in an Image control.
The GglGetStaticMap function Unit examples (WEBDEV): The GglGetStaticMap function
[ + ] Using GglGetStaticMap function to display a Google map in an Image control.
Minimum version required
  • Version 14
This page is also available for…
Comments
Errors that may occur in Maps not working:
A) in the Google developer environment, a valid credit/debit card must be registered in the billing method of payment. If you do not have a card that has valid usage data, it may also give an error.
B) environment changes may be necessary to create new api key.
C) the api is not ok, because for the maps it has a
Different web and mobile apis, minus watching an updated tutorial.
Boller
30 Aug. 2023
Advanced Google Maps API
The functions covered by WEBDEV for Google Maps API in the online manual appear to be relatively basic.

Do you have any examples/tutorials/guides on how to create/load/manipulate Google Map Polygons and other more advanced maps features?

I've written Google API stuff in Javascript, but invested in WEBDEV as I understood that this would allow me to control Google Maps advanced features directly without having to resort to Javascript.
RenardZorro
02 Jan. 2018

Last update: 06/22/2023

Send a report | Local help