PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Saving the Google map
  • Key for Google Static Map
  • Possible error cases
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
GglGetStaticMap (Function)
In French: GglRécupèreCarte
Retrieves the map of a specific location via the Google Maps service.
Versions 22 and later
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 22
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
MyImage is Image
MyImage = GglGetStaticMap(40.714728, 73.998672, 14, 400, 400)
// Code used to display a journey
MyImage is Image
Point is gglMapParameter
Coord is gglCoordinate
Mark is gglMarker

Point..Path..Color = LightYellow
Point..Path..Thickness = 6
Point..Path..Opacity = 100

FOR EACH ROW i OF TABLE_Table1
Coord..Latitude = COL_Latitude
Coord..Longitude = COL_Longitude
ArrayAdd(Point..Path..Point, Coord)
END
Point..Format = gglPNG32

MyImage = GglGetStaticMap(40.6423, -73.7959, 12, 600, 600, gglHybrid, Point)

IMG_Image2 = MyImage
Syntax

Retrieving a map with configuration of centering Hide the details

<Result> = GglGetStaticMap(<Latitude> , <Longitude> , <Zoom> , <Image Width> , <Image Height> [, <Type of Map> [, <Advanced Parameters>]])
<Result>: Image variable
Name of the Image variable containing the map. The map is returned to the specified dimensions.
<Latitude>: Real
Latitude of the central point of the map.
<Longitude>: Real
Longitude of the central point of the map.
<Zoom>: Integer
Zoom level. This parameter can correspond to:
  • an integer included between 0 (most distant zoom) and 19 (very close zoom, scale of a building for example).
  • the gglAutoZoom constant. In this case, the zoom is automatically chosen according to the markers or to the area defined in <Advanced Parameters>. A WLanguage error occurs if this constant is used without <Advanced Parameters>.
<Image Width>: Integer
Width (in pixels) of the image of the map to retrieve. The maximum width is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Image Height>: Integer
Height (in pixels) of the image of the map to retrieve. The maximum height is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Type of Map>: Optional character string constant
Type of map to retrieve. This parameter can correspond to one of the following constants:
gglHybridCombine the road map and the satellite view.
gglMobileDeviceMap optimized for the constraints specific to the display on a Mobile device
gglRoadmap
(Default value)
Road map.
gglSatelliteSatellite view.
gglTerrainGeographical map displaying the relief and the vegetation.
<Advanced Parameters>: Optional gglMapParameter variable
Name of the gglMapParameter variable containing the advanced setting of the map. If this parameter is not specified, the map will be in Gif format and it will contain no marker, no path and no area.

Retrieving a map with automatic centering Hide the details

<Result> = GglGetStaticMap(<Image Width> , <Image Height> , <Type of Map> , <Advanced Parameters>)
<Result>: Image variable
Name of the Image variable containing the map. The map is returned to the specified dimensions.
<Image Width>: Integer
Width (in pixels) of the image of the map to retrieve. The maximum width is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Image Height>: Integer
Height (in pixels) of the image of the map to retrieve. The maximum height is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Type of Map>: Character String constant
Type of map to retrieve. This parameter can correspond to one of the following constants:
gglHybridCombine the road map and the satellite view.
gglMobileDeviceMap optimized for the constraints specific to the display on a Mobile device
gglRoadmapRoad map.
gglSatelliteSatellite view.
gglTerrainGeographical map displaying the relief and the vegetation.
<Advanced Parameters>: gglMapParameter variable
Name of the gglMapParameter variable containing the advanced setting of the map.
This syntax is obsolete from version 2 of the mapping service: the Google key is not required anymore.

Retrieving a map with configuration of centering Hide the details

<Result> = GglGetStaticMap(<Google Key> , <Latitude> , <Longitude> , <Zoom> , <Image Width> , <Image Height> [, <Type of Map> [, <Advanced Parameters>]])
<Result>: Image variable
Name of the Image variable containing the map. The map is returned to the specified dimensions.
<Google Key>: Character string (with quotes)
Authentication key for the Google Maps service. This key is supplied by Google.
Note: Since version 2 of the Google service, this parameter has become obsolete and it is ignored.Note: The Google key is required for an advanced use only (use with charge for more than 25000 requests per day).
<Latitude>: Real
Latitude of the central point of the map.
<Longitude>: Real
Longitude of the central point of the map.
<Zoom>: Integer
Zoom level. This parameter can correspond to:
  • an integer included between 0 (most distant zoom) and 19 (very close zoom, scale of a building for example).
  • the gglAutoZoom constant. In this case, the zoom is automatically chosen according to the markers or to the area defined in <Advanced Parameters>. A WLanguage error occurs if this constant is used without <Advanced Parameters>.
<Image Width>: Integer
Width (in pixels) of the image of the map to retrieve. The maximum width is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Image Height>: Integer
Height (in pixels) of the image of the map to retrieve. The maximum height is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Type of Map>: Optional character string constant
Type of map to retrieve. This parameter can correspond to one of the following constants:
gglHybridCombine the road map and the satellite view.
gglMobileDeviceMap optimized for the constraints specific to the display on a Mobile device
gglRoadmap
(Default value)
Road map.
gglSatelliteSatellite view.
gglTerrainGeographical map displaying the relief and the vegetation.
<Advanced Parameters>: Optional gglMapParameter variable
Name of the gglMapParameter variable containing the advanced setting of the map. If this parameter is not specified, the map will be in Gif format and it will contain no marker, no path and no area.
This syntax is obsolete from version 2 of the mapping service: the Google key is not required anymore.

Retrieving a map with automatic centering Hide the details

<Result> = GglGetStaticMap(<Google Key> , <Image Width> , <Image Height> , <Type of Map> , <Advanced Parameters>)
<Result>: Image variable
Name of the Image variable containing the map. The map is returned to the specified dimensions.
<Google Key>: Character string (with quotes)
Authentication key for the Google Maps service. This key is supplied by Google.
Note: Since version 2 of the Google service, this parameter has become obsolete and it is ignored.Note: The Google key is required for an advanced use only (use with charge for more than 25000 requests per day).
<Image Width>: Integer
Width (in pixels) of the image of the map to retrieve. The maximum width is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Image Height>: Integer
Height (in pixels) of the image of the map to retrieve. The maximum height is set to 640 pixels. This limit is defined by the Google Maps service at the date of publication of this page.
<Type of Map>: Character String constant
Type of map to retrieve. This parameter can correspond to one of the following constants:
gglHybridCombine the road map and the satellite view.
gglMobileDeviceMap optimized for the constraints specific to the display on a Mobile device
gglRoadmapRoad map.
gglSatelliteSatellite view.
gglTerrainGeographical map displaying the relief and the vegetation.
<Advanced Parameters>: gglMapParameter variable
Name of the gglMapParameter variable containing the advanced setting of the map.
Remarks

Saving the Google map

To save the Google map in a file, you can:

Key for Google Static Map

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.
Note: The Google key is required for an advanced use only (use with charge for more than 25000 requests per day).

Possible error cases

The Google Maps service may not be able to return a valid image according to the location or to the requested zoom.
No data is returned if the limitations defined by the Google Maps service are exceeded (size of the image too large, too many points in a path, and so on). A "HttpBadRequest" error is returned.
See the documentation about the gglMapParameter variables for more details.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230ggl.dll
Windows Mobile wp230ggl.dll
Android wd230android.jar
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment