Table of contents
Google Curated Content
Download API definition:
This operation is a Technical Preview and is available for testing purposes only. Do not use in production.
POST https://dev-api.bentley.com/curated-content/google/map-tiles/2d

Retrieves information and credentials that allow you to access the tiled content data for visualization and analysis.

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.google-2d-tiles-styles+json is recommended.

Request body

Access2DTilesRequest

Name
Type
Required?
Description
mapType
Yes
language
String
Yes

An IETF language tag that specifies the language used to display information on the tiles. For example, en-US specifies the English language as spoken in the United States.

region
String
Yes

A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user. For example, US.

imageFormat
String
No
scale
No
highDpi
Boolean
No

Specifies whether to return high-resolution tiles. If the scale-factor is increased, highDpi is used to increase the size of the tile. Normally, increasing the scale factor enlarges the resulting tile into an image of the same size, which lowers quality. With highDpi, the resulting size is also increased, preserving quality. DPI stands for Dots per Inch, and High DPI means the tile renders using more dots per inch than normal. If true, then the number of pixels in each of the x and y dimensions is multiplied by the scale factor (that is , scaleFactor2x or scaleFactor4x). The coverage area of the tile remains unchanged. This parameter works only with scale values of scaleFactor2x or scaleFactor4x. It has no effect on scaleFactor1x scale tiles.

layerTypes
No
overlay
Boolean
No

A boolean value that specifies whether layerTypes should be rendered as a separate overlay, or combined with the base imagery. When true, the base map isn't displayed. If you haven't defined any layerTypes, then this value is ignored.

styles
No

An array of JSON style objects that specify the appearance and detail level of map features such as roads, parks, and built-up areas. Styling is used to customize the standard Google base map. The styles parameter is valid only if the map type is roadmap.

Example

json
{
    "mapType": "terrain",
    "language": "en-US",
    "region": "US",
    "imageFormat": "jpeg",
    "scale": "scaleFactor2x",
    "highDpi": true,
    "layerTypes": [
        "layerRoadmap"
    ]
}

Response 200 OK

OK

json
{
    "type": "IMAGERY",
    "viewportBaseUrl": "https://tile.googleapis.com/tile/v1/viewport",
    "tileBaseUrl": "https://tile.googleapis.com/v1/2dtiles",
    "accessToken": "ya29.c.c0ASRK0Gb9O...5I0c5-",
    "session": {
        "token": "AJV....HyTiZNQ",
        "expiry": "1747320703",
        "tileWidth": 256,
        "imageFormat": "png",
        "tileHeight": 256
    }
}

Response 400 Bad Request

The 400 (Bad Request) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)

json
{
    "error": {
        "code": "InvalidGoogleCuratedContentRequest",
        "message": "Request body is invalid.",
        "details": [{
            "code": "InvalidRequestBody",
            "message": "Invalid request body.",
            "target": "mapType"
        }]
    }
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

ContentType

The type of content.

Name
Type
Description
3DTILES
String
IMAGERY
String

Access2DTilesResponse

Name
Type
Description
viewportBaseUrl
String

The base url for the viewport requests. The viewport defines the size of the box that frames the world scene. This request also returns the attribution string that you must display on your map when you display roadmap and satellite tiles.

tileBaseUrl
String

The base url for the tileset requests.

accessToken
String

The token to be included with each tile request, using Bearer format. This token is different than the access token used throughout the rest of the REST API. It provides access to the content for approximately one hour. To continue using the content after the allotted time, simple re-request the endpoint for a new token.

SessionInformation

Name
Type
Description
token
String

A session token value that you must include in all of your Map Tiles API requests.

expiry
String

A string that contains the time (in seconds since the epoch) at which the token expires. A session token is valid for two weeks from its creation time, but this policy might change without notice.

tileWidth
Number

The width of the tiles measured in pixels.

tileHeight
Number

The height of the tiles measured in pixels.

imageFormat
String

The image format, which can be either png or jpeg.

Access2DTilesRequest

Name
Type
Description
mapType
language
String

An IETF language tag that specifies the language used to display information on the tiles. For example, en-US specifies the English language as spoken in the United States.

region
String

A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user. For example, US.

imageFormat
String
scale
highDpi
Boolean

Specifies whether to return high-resolution tiles. If the scale-factor is increased, highDpi is used to increase the size of the tile. Normally, increasing the scale factor enlarges the resulting tile into an image of the same size, which lowers quality. With highDpi, the resulting size is also increased, preserving quality. DPI stands for Dots per Inch, and High DPI means the tile renders using more dots per inch than normal. If true, then the number of pixels in each of the x and y dimensions is multiplied by the scale factor (that is , scaleFactor2x or scaleFactor4x). The coverage area of the tile remains unchanged. This parameter works only with scale values of scaleFactor2x or scaleFactor4x. It has no effect on scaleFactor1x scale tiles.

layerTypes
overlay
Boolean

A boolean value that specifies whether layerTypes should be rendered as a separate overlay, or combined with the base imagery. When true, the base map isn't displayed. If you haven't defined any layerTypes, then this value is ignored.

styles

An array of JSON style objects that specify the appearance and detail level of map features such as roads, parks, and built-up areas. Styling is used to customize the standard Google base map. The styles parameter is valid only if the map type is roadmap.

MapType

The type of base map. roadmap is the standard Google Maps painted on map tiles. satellite is satellite imagery. terrain is Terrain imagery. When selecting terrain as the map type, you must also include the layerRoadmap layer type.

Name
Type
Description
roadmap
String
satellite
String
terrain
String

Scale

Scales-up the size of map elements (such as road labels), while retaining the tile size and coverage area of the default tile. Increasing the scale also reduces the number of labels on the map, which reduces clutter. The default scale is scaleFactor1x.

Name
Type
Description
scaleFactor1x
String
scaleFactor2x
String
scaleFactor4x
String

LayerTypes

An array of values that specifies the layer types added to the map.

StyleObject featureType

The features to select for this style modification. Features are geographic characteristics on the map, including roads, parks, bodies of water, and more. If not specified, all features are selected.

Name
Type
Description
all
String
administrative
String
administrative.country
String
administrative.land_parcel
String
administrative.locality
String
administrative.neighborhood
String
administrative.province
String
landscape
String
landscape.man_made
String
landscape.natural
String
landscape.natural.landcover
String
landscape.natural.terrain
String
poi
String
poi.attraction
String
poi.business
String
poi.government
String
poi.medical
String
poi.park
String
poi.place_of_worship
String
poi.school
String
poi.sports_complex
String
road
String
road.arterial
String
road.highway
String
road.highway.controlled_access
String
road.local
String
transit
String
transit.line
String
transit.station
String
transit.station.airport
String
transit.station.bus
String
transit.station.rail
String
water
String

StyleObject elementType

The property of the specified feature to select. Elements are sub-parts of a feature, including labels and geometry. If not specified, all elements of the feature are selected.

Name
Type
Description
all
String
geometry
String
geometry.fill
String
geometry.stroke
String
labels
String
labels.icon
String
labels.text
String
labels.text.fill
String
labels.text.stroke
String

StyleObject

A JSON style object that specifies the appearance and detail level of map features.

Name
Type
Description
StyleObject featureType

The features to select for this style modification. Features are geographic characteristics on the map, including roads, parks, bodies of water, and more. If not specified, all features are selected.

StyleObject elementType

The property of the specified feature to select. Elements are sub-parts of a feature, including labels and geometry. If not specified, all elements of the feature are selected.

stylers

The rules to apply to the selected features and elements. Stylers indicate the color, visibility, and weight of the feature.

Styler visibility

Indicates whether and how the element appears on the map. 'simplified' removes some style features from the affected features.

Name
Type
Description
on
String
off
String
simplified
String

Styler

A style rule that can be applied to map features and elements.

Name
Type
Description
hue
String

An RGB hex string of format #RRGGBB that indicates the basic color.

lightness
Number

A floating point value between -100 and 100 that indicates the percentage change in brightness of the element.

saturation
Number

A floating point value between -100 and 100 that indicates the percentage change in intensity of the basic color.

gamma
Number

A floating point value between 0.01 and 10.0 that indicates the amount of gamma correction to apply to the element.

invert_lightness
Boolean

If true, inverts the existing lightness. This is useful for quickly switching to a darker map with white text.

Styler visibility

Indicates whether and how the element appears on the map. 'simplified' removes some style features from the affected features.

color
String

An RGB hex string of format #RRGGBB that sets the color of the feature.

weight
Integer

An integer value, greater than or equal to zero, that sets the weight of the feature in pixels.

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

details

Optional array of more specific errors.

Detailed Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error Detailed information.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

message
String

A human-readable representation of the error.

target
String, null

The target of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Was this page helpful?