|
|
|
|
- Saving the Google map
- Key for Google Static Map
- Possible error cases
GglGetStaticMap (Function) In french: GglRécupèreCarte Retrieves the map of a specific location via the Google Maps service. MyGoogleKey is string MyGoogleKey = "Google key example" MyImage is Image MyImage = GglGetStaticMap(MyGoogleKey, 40.714728, 73.998672, 14, 400, 400) // Code used to display a journey MyGoogleKey is string MyGoogleKey = "Google key example" 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(MyGoogleKey, 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(<Google key> , <Latitude> , <Longitude> , <Zoom> , <Image width> , <Image height> [, <Type of map> [, <Advanced settings>]])
<Result>: Image variable Name of the Image variable containing the map. The map is returned to the specified dimensions. <Google key>: Character string Authentication key for the Google Maps service. This key is supplied by Google.Remark: 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 the area defined in <Advanced settings>. A WLanguage error occurs if this constant is used without <Advanced settings>.
<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:
| | gglHybrid | Combine the road map and the satellite view. | gglMobileDevice | Map optimized for the constraints specific to the display on a Mobile device | gglRoadmap (Default value) | Roadmap. | gglSatellite | Satellite view. | gglTerrain | Geographical map displaying the relief and the vegetation. |
<Advanced settings>: Optional gglMapParameter variable Name of the gglMapParameter variable containing the advanced settings 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(<Google key> , <Image width> , <Image height> , <Type of map> , <Advanced settings>)
<Result>: Image variable Name of the Image variable containing the map. The map is returned to the specified dimensions. <Google key>: Character string Authentication key for the Google Maps service. This key is supplied by Google.Remark: 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:
| | gglHybrid | Combine the road map and the satellite view. | gglMobileDevice | Map optimized for the constraints specific to the display on a Mobile device | gglRoadmap | Roadmap. | gglSatellite | Satellite view. | gglTerrain | Geographical map displaying the relief and the vegetation. |
<Advanced settings>: gglMapParameter variable Name of the gglMapParameter variable containing the advanced settings of the map. | 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 a map with configuration of centering Hide the details
<Result> = GglGetStaticMap(<Latitude> , <Longitude> , <Zoom> , <Image width> , <Image height> [, <Type of map> [, <Advanced settings>]])
<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 the area defined in <Advanced settings>. A WLanguage error occurs if this constant is used without <Advanced settings>.
<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:
| | gglHybrid | Combine the road map and the satellite view. | gglMobileDevice | Map optimized for the constraints specific to the display on a Mobile device | gglRoadmap (Default value) | Roadmap. | gglSatellite | Satellite view. | gglTerrain | Geographical map displaying the relief and the vegetation. |
<Advanced settings>: Optional gglMapParameter variable Name of the gglMapParameter variable containing the advanced settings 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 since June 11th 2018. From now on, as the Google license has evolved, only the syntax using the Google key must be used. |
Retrieving a map with automatic centering Hide the details
<Result> = GglGetStaticMap(<Image width> , <Image height> , <Type of map> , <Advanced settings>)
<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:
| | gglHybrid | Combine the road map and the satellite view. | gglMobileDevice | Map optimized for the constraints specific to the display on a Mobile device | gglRoadmap | Roadmap. | gglSatellite | Satellite view. | gglTerrain | Geographical map displaying the relief and the vegetation. |
<Advanced settings>: gglMapParameter variable Name of the gglMapParameter variable containing the advanced settings of the map. Remarks To save the Google map in a file, you can: Key for Google Static Map 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. 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. For more details, see the documentation about the gglMapParameter variables.
Related Examples:
|
Unit examples (WINDEV): The GglGetStaticMap function
[ + ] Using gglGetMap to display a Google map in an Image control.
|
|
Unit examples (WEBDEV): The GglGetStaticMap function
[ + ] Using GglGetStaticMap function to display a Google map in an Image control.
|
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|