English中文

GoogleEarthEnterpriseMapsProvider

new Cesium.GoogleEarthEnterpriseMapsProvider(options)

要构造 GoogleEarthEnterpriseMapsProvider,请调用 To construct a GoogleEarthEnterpriseMapsProvider, call GoogleEarthEnterpriseImageryProvider.fromUrl。不要直接调用构造函数。 . Do not call the constructor directly.
使用 Google Earth Imagery API 提供平铺图像。注意:此图像提供程序无法与公共 Google 地球服务器配合使用。它与 Google 地球企业服务器配合使用。默认情况下,Google 地球企业版服务器不会设置 Provides tiled imagery using the Google Earth Imagery API. Notes: This imagery provider does not work with the public Google Earth servers. It works with the Google Earth Enterprise Server. By default the Google Earth Enterprise server does not set the Cross-Origin Resource Sharing 标头。您可以使用添加这些标头的代理服务器,也可以在 /opt/google/gehttpd/conf/gehttpd.conf 中将“标头设置 Access-Control-Allow-Origin "*"”选项添加到“<Directory />”和“<Directory "/opt/google/gehttpd/htdocs">”指令中。该提供程序可与 2D Maps API 一起使用,作为 Google 地球企业版的一部分。对于 3D Earth API 使用,有必要使用 headers. You can either use a proxy server which adds these headers, or in the /opt/google/gehttpd/conf/gehttpd.conf and add the 'Header set Access-Control-Allow-Origin "*"' option to the '&lt;Directory /&gt;' and '&lt;Directory "/opt/google/gehttpd/htdocs"&gt;' directives. This provider is for use with 2D Maps API as part of Google Earth Enterprise. For 3D Earth API uses, it is necessary to use GoogleEarthEnterpriseImageryProvider
名称 Name 类型 Type 说明 Description
options GoogleEarthEnterpriseMapsProvider.ConstructorOptions 描述初始化选项的对象 Object describing initialization options
抛出: Throws:
  • RuntimeError :找不到通道(id)为的图层 : Could not find layer with channel (id) of options.channel.
  • RuntimeError :在频道(id)中找不到版本 : Could not find a version in channel (id) options.channel.
  • RuntimeError : Unsupported projection data.projection.
示例: Example:
const google = await Cesium.GoogleEarthEnterpriseMapsProvider.fromUrl("https://earth.localdomain", 1008);
另见: See:

成员 Members

static Cesium.GoogleEarthEnterpriseMapsProvider.logoUrl : string

获取或设置要在片尾字幕中显示的 Google 地球徽标的 URL。 Gets or sets the URL to the Google Earth logo for display in the credit.
获取当前使用的图像通道(id)。 Gets the imagery channel (id) currently being used.
获取此图像提供程序处于活动状态时要显示的信用。通常,这用于证明图像的来源。 Gets the credit to display when this imagery provider is active. Typically this is used to credit the source of the imagery.
获取当图像提供程序遇到异步错误时引发的事件。通过订阅该事件,您将收到错误通知,并有可能从中恢复。事件监听器传递一个实例 Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of TileProviderError.
获取一个值,该值指示此图像提供程序提供的图像是否包含 Alpha 通道。如果此属性为 false,则 Alpha 通道(如果存在)将被忽略。如果此属性为 true,则任何没有 Alpha 通道的图像都将被视为其 Alpha 在任何地方都是 1.0。当此属性为 false 时,内存使用量和纹理上传时间都会减少。 Gets a value indicating whether or not the images provided by this imagery provider include an alpha channel. If this property is false, an alpha channel, if present, will be ignored. If this property is true, any images without an alpha channel will be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage and texture upload time are reduced.

readonly maximumLevel : number|undefined

获取可以请求的最大详细程度。 Gets the maximum level-of-detail that can be requested.
获取可以请求的最低详细程度。 Gets the minimum level-of-detail that can be requested.
获取Google Earth服务器上数据的url路径。 Gets the url path of the data on the Google Earth server.
获取此提供者使用的代理。 Gets the proxy used by this provider.
获取此实例提供的图像的矩形(以弧度为单位)。 Gets the rectangle, in radians, of the imagery provided by this instance.
获取从提供者请求的数据类型。 Gets the type of data that is being requested from the provider.
获取图块丢弃策略。如果未定义,则丢弃策略负责通过其 shouldDiscardImage 函数过滤掉“丢失”的图块。如果此函数返回未定义,则不会过滤任何图块。 Gets the tile discard policy. If not undefined, the discard policy is responsible for filtering out "missing" tiles via its shouldDiscardImage function. If this function returns undefined, no tiles are filtered.
获取每个图块的高度(以像素为单位)。 Gets the height of each tile, in pixels.
获取每个图块的宽度(以像素为单位)。 Gets the width of each tile, in pixels.
获取此提供程序使用的切片方案。 Gets the tiling scheme used by this provider.
获取 Google Earth 地图服务器的 URL。 Gets the URL of the Google Earth MapServer.
获取此提供程序使用的数据的版本。 Gets the version of the data used by this provider.

方法 Methods

static Cesium.GoogleEarthEnterpriseMapsProvider.fromUrl(url, options)Promise.<GoogleEarthEnterpriseMapsProvider>

使用 Google Earth Imagery API 创建平铺图像提供程序。 Creates a tiled imagery provider using the Google Earth Imagery API.
名称 Name 类型 Type 说明 Description
url Resource | string 托管图像的 Google 地球服务器的 URL。 The url of the Google Earth server hosting the imagery.
options GoogleEarthEnterpriseMapsProvider.ConstructorOptions 可选 optional 描述初始化选项的对象 Object describing initialization options
返回: Returns:
创建的GoogleEarthEnterpriseMapsProvider。 The created GoogleEarthEnterpriseMapsProvider.
抛出: Throws:
  • RuntimeError :找不到通道(id)为的图层 : Could not find layer with channel (id) of options.channel.
  • RuntimeError :在频道(id)中找不到版本 : Could not find a version in channel (id) options.channel.
  • RuntimeError : Unsupported projection data.projection.
示例: Example:
const google = await Cesium.GoogleEarthEnterpriseMapsProvider.fromUrl("https://earth.localdomain", 1008);
获取显示给定图块时要显示的积分。 Gets the credits to be displayed when a given tile is displayed.
名称 Name 类型 Type 说明 Description
x number 平铺 X 坐标。 The tile X coordinate.
y number 平铺 Y 坐标。 The tile Y coordinate.
level number 瓷砖水平; The tile level;
返回: Returns:
显示图块时要显示的制作人员名单。 The credits to be displayed when the tile is displayed.

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

该图像提供程序当前不支持选取要素,因此该函数仅返回 undefined。 Picking features is not currently supported by this imagery provider, so this function simply returns undefined.
名称 Name 类型 Type 说明 Description
x number 平铺 X 坐标。 The tile X coordinate.
y number 平铺 Y 坐标。 The tile Y coordinate.
level number 瓷砖级别。 The tile level.
longitude number 选择要素的经度。 The longitude at which to pick features.
latitude number 选择特征的纬度。 The latitude at which to pick features.
返回: Returns:
未定义,因为不支持挑选。 Undefined since picking is not supported.

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

请求给定图块的图像。 Requests the image for a given tile.
名称 Name 类型 Type 说明 Description
x number 平铺 X 坐标。 The tile X coordinate.
y number 平铺 Y 坐标。 The tile Y coordinate.
level number 瓷砖级别。 The tile level.
request Request 可选 optional 请求对象。仅供内部使用。 The request object. Intended for internal use only.
返回: Returns:
对图像的承诺,该承诺将在图像可用时解析,或者如果对服务器的活动请求太多,则未定义,并且应稍后重试该请求。 A promise for the image that will resolve when the image is available, or undefined if there are too many active requests to the server, and the request should be retried later.

类型定义 Type Definitions

Cesium.GoogleEarthEnterpriseMapsProvider.ConstructorOptions

GoogleEarthEnterpriseMapsProvider 构造函数的初始化选项 Initialization options for the GoogleEarthEnterpriseMapsProvider constructor
属性: Properties:
名称 Name 类型 Type Attributes 默认值 Default 说明 Description
channel number 从服务器请求数据时要使用的通道 (id)。通过查看位于以下位置的 json 文件可以找到频道号:earth.localdomain/default_map/query?request=Json&vars=geeServerDefs /default_map 路径可能会有所不同,具体取决于您的 Google 地球企业版服务器配置。查找与“ImageryMaps”请求类型关联的“id”。可能有多个 id 可用。示例: { 层:[ { id:1002,requestType:“ImageryMaps”},{ id:1007,requestType:“VectorMapsRaster”} ] } The channel (id) to be used when requesting data from the server. The channel number can be found by looking at the json file located at: earth.localdomain/default_map/query?request=Json&vars=geeServerDefs The /default_map path may differ depending on your Google Earth Enterprise server configuration. Look for the "id" that is associated with a "ImageryMaps" requestType. There may be more than one id available. Example: { layers: [ { id: 1002, requestType: "ImageryMaps" }, { id: 1007, requestType: "VectorMapsRaster" } ] }
path string <可选> &lt;optional>
“/默认地图” "/default_map" 托管图像的 Google 地球服务器的路径。 The path of the Google Earth server hosting the imagery.
maximumLevel number <可选> &lt;optional>
Google 地球企业版服务器支持的最大详细程度,如果没有限制则未定义。 The maximum level-of-detail supported by the Google Earth Enterprise server, or undefined if there is no limit.
tileDiscardPolicy TileDiscardPolicy <可选> &lt;optional>
确定图块是否无效并应被丢弃的策略。为了确保没有瓷砖被丢弃,构建并传递一个 The policy that determines if a tile is invalid and should be discarded. To ensure that no tiles are discarded, construct and pass a NeverTileDiscardPolicy 对于这个参数。 for this parameter.
ellipsoid Ellipsoid <可选> &lt;optional>
Ellipsoid.default 椭球体。如果未指定,则使用默认椭球体。 The ellipsoid. If not specified, the default ellipsoid is used.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.