new Cesium.Google2DImageryProvider(options)

此天体通常不直接即时化,使用 Google2DImageryProvider.fromIonAssetIdGoogle2DImageryProvider.fromUrl .
Provides 2D image tiles from Google 2D Tiles. Google 2D Tiles只能使用Google地理编码器.
Name Type Description
options Google2DImageryProvider.ConstructorOptions 描述初始化选项的对象
Examples:
// Google 2D imagery provider
const googleTilesProvider = Cesium.Google2DImageryProvider.fromIonAssetId({
    assetId: 3830184
});
// Use your own Google api key
Cesium.GoogleMaps.defaultApiKey = "your-api-key";

const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({
    mapType: "SATELLITE"
});
See:

Members

readonly credit : Credit

当图像提供者活动时, 获得信用值以显示 。 通常,这是用来信用的 图像的来源.

readonly errorEvent : Event

获得一个在图像提供者遇到同步错误时上升的事件 。 通过签名 对事件,您将被通知错误,并有可能从中恢复。 活动听众 are passed an instance of TileProviderError.

readonly hasAlphaChannel : boolean

获得一个表示图像提供者是否提供的图像的值 包括一个α通道。 如果这个属性是虚假的, 一个 alpha 通道, 如果存在, 将会 将被忽略。 如果此属性属实, 任何没有 alpha 通道的图像都会被处理 好像他们的α是1.0 到处都是。 当此属性为虚假时, 内存使用 并缩短纹理上传时间.

readonly maximumLevel : number|undefined

获取可以请求的最多详细级别.

readonly minimumLevel : number

获取可以请求的最小详细级别。 一般来说, 图像矩小时才应使用最低水平 足以使最低水平的瓦片数量很小。 图像 提供商在最低水平上拥有数块以上的牌,将导致 rendering problems.

readonly proxy : Proxy

获取此提供者使用的代理 .

readonly rectangle : Rectangle

获得实例提供的图像的弧度矩形.

readonly tileDiscardPolicy : TileDiscardPolicy

获取瓷砖丢弃策略 。 如果未定义, 丢弃策略负责 用于通过它应当的DiscardImage函数过滤出“缺少”牌。 如果此函数 返回未定义,不过滤牌.

readonly tileHeight : number

获得每个瓦片的高度,以像素为单位.

readonly tileWidth : number

获得每个瓦片的宽度,以像素为单位.

readonly tilingScheme : TilingScheme

获得提供者使用的平板方案.

readonly url : string

获得Google 2D图像服务器的 NT 0 .

Methods

static Cesium.Google2DImageryProvider.fromIonAssetId(options)Promise.<Google2DImageryProvider>

Creates an ImageryProvider which provides 2D global tiled imagery from Google 2D Tiles, streamed using the Cesium ion REST API.
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
assetId string The Cesium ion asset id.
mapType "satellite" | "terrain" | "roadmap" “卫星” optional Google地图图像的地图类型. 有效的选择是卫星、地形和路线图。 如果设置了覆盖LayerType,则忽略了映射Type,返回一个透明的覆盖. 如果覆盖MapType未定义,则返回一个地图Type的基图。 层路图覆盖LayerType包含在地形和路线图地图Types中.
language string "en_US" optional an IETF language tag that specifies the language used to display information on the tiles
region string "US" optional A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user.
overlayLayerType "layerRoadmap" | "layerStreetview" | "layerTraffic" optional 返回带有指定层的透明覆盖图。 如果没有提供值,则返回映射图的基图。 使用多例 Google2DImagery Provider 将多个 Google 地图覆盖到一个场景中. 层路图包含在地形图和路线图图Types中,因此在地形或路线图上加注没有效果.
styles object optional 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 mapType is roadmap. For the complete style syntax, see the (Google Style Reference).
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid. If not specified, the default ellipsoid is used.
minimumLevel number 0 optional The minimum level-of-detail supported by the imagery provider. Take care when specifying 表示最低水平的瓦片数量很小,例如四块或四块以下。 数量可能更多 导致产生问题.
maximumLevel number 22 optional 图像提供者支持的最高详细水平.
rectangle Rectangle Rectangle.MAX_VALUE optional The rectangle, in radians, covered by the image.
credit Credit | string optional 数据源的信用,在画布上显示.
Returns:
一个能解决Google2DImagery Provider问题的承诺.
Examples:
// Google 2D imagery provider
const googleTilesProvider = Cesium.Google2DImageryProvider.fromIonAssetId({
    assetId: 3830184
});
// Google 2D roadmap overlay with custom styles
const googleTilesProvider = Cesium.Google2DImageryProvider.fromIonAssetId({
    assetId: 3830184,
    overlayLayerType: "layerRoadmap",
    styles: [
        {
            stylers: [{ hue: "#00ffe6" }, { saturation: -20 }],
        },
        {
            featureType: "road",
            elementType: "geometry",
            stylers: [{ lightness: 100 }, { visibility: "simplified" }],
        },
    ],
});

static Cesium.Google2DImageryProvider.fromUrl(options)Promise.<Google2DImageryProvider>

Creates an ImageryProvider which provides 2D global tiled imagery from Google 2D Tiles.
Name Type Description
options object 下列属性的对象 :
Name Type Default Description
key string GoogleMaps.defaultApiKey optional Your API key to access Google 2D Tiles. See https://developers.google.com/maps/documentation/javascript/get-api-key for instructions on how to create your own key.
mapType "satellite" | "terrain" | "roadmap" “卫星” optional Google地图图像的地图类型. 有效的选择是卫星、地形和路线图。 如果设置了覆盖LayerType,则忽略了映射Type,返回一个透明的覆盖. 如果覆盖MapType未定义,则返回一个地图Type的基图。 层路图覆盖LayerType包含在地形和路线图地图Types中.
language string "en_US" optional an IETF language tag that specifies the language used to display information on the tiles
region string "US" optional A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user.
overlayLayerType "layerRoadmap" | "layerStreetview" | "layerTraffic" optional 返回带有指定层的透明覆盖图。 如果没有提供值,则返回映射图的基图。 使用多例 Google2DImagery Provider 将多个 Google 地图覆盖到一个场景中. 层路图包含在地形图和路线图图Types中,因此在地形或路线图上加注没有效果.
styles object optional 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 mapType is roadmap. For the complete style syntax, see the (Google Style Reference).
ellipsoid Ellipsoid Ellipsoid.default optional The ellipsoid. If not specified, the default ellipsoid is used.
minimumLevel number 0 optional The minimum level-of-detail supported by the imagery provider. Take care when specifying 表示最低水平的瓦片数量很小,例如四块或四块以下。 数量可能更多 导致产生问题.
maximumLevel number 22 optional 图像提供者支持的最高详细水平.
rectangle Rectangle Rectangle.MAX_VALUE optional The rectangle, in radians, covered by the image.
credit Credit | string optional 数据源的信用,在画布上显示.
Returns:
一个能解决Google2DImagery Provider问题的承诺.
Examples:
// Use your own Google api key
Cesium.GoogleMaps.defaultApiKey = "your-api-key";

const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({
    mapType: "satellite"
});
// Google 2D roadmap overlay with custom styles
Cesium.GoogleMaps.defaultApiKey = "your-api-key";

const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({
    overlayLayerType: "layerRoadmap",
    styles: [
        {
            stylers: [{ hue: "#00ffe6" }, { saturation: -20 }],
        },
        {
            featureType: "road",
            elementType: "geometry",
            stylers: [{ lightness: 100 }, { visibility: "simplified" }],
        },
    ],
});

getTileCredits(x, y, level)Array.<Credit>|undefined

获得在显示特定瓦片时显示的信用值.
Name Type Description
x number 瓷砖X坐标.
y number 瓦片Y坐标.
level number 瓦片级;
Returns:
显示瓷砖时要显示的信用值 .

pickFeatures(x, y, level, longitude, latitude)undefined

Picking 特性目前不被此图像提供者支持, 因此此函数仅返回 undefined.
Name Type Description
x number 瓷砖X坐标.
y number 瓦片Y坐标.
level number 瓦片级.
longitude number 选择特征的经度 .
latitude number 选择特征的纬度.
Returns:
不支持选择后未定义 .

requestImage(x, y, level, request)Promise.<ImageryTypes>|undefined

请求给定的瓦片的图像 .
Name Type Description
x number 瓷砖X坐标.
y number 瓦片Y坐标.
level number 瓦片级.
request Request optional 请求对象 。 仅供内部使用.
Returns:
承诺在图像可用时解决图像,或 如果服务器的主动请求过多, 未定义, 请求应在稍后重审 .

Type Definitions

Cesium.Google2DImageryProvider.ConstructorOptions

Google2DImagery 创建器的初始化选项
Properties:
Name Type Attributes Default Description
key string Google api 密钥随瓷砖请求发送 .
session string Google 会话符号跟踪您的地图和视图的当前状态 .
url string | Resource | IonResource Google 2D 地图端点.
tileWidth string 每个瓦片以像素表示的宽度.
tileHeight string 每个瓦片在像素中的高度.
ellipsoid Ellipsoid <optional>
Ellipsoid.default The ellipsoid. If not specified, the default ellipsoid is used.
minimumLevel number <optional>
0 The minimum level-of-detail supported by the imagery provider. Take care when specifying 表示最低水平的瓦片数量很小,例如四块或四块以下。 数量可能更多 导致产生问题.
maximumLevel number <optional>
22 图像提供者支持的最高详细水平.
rectangle Rectangle <optional>
Rectangle.MAX_VALUE The rectangle, in radians, covered by the image.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.