new MapGISTileAvailability(layers)
MapGIS的TileAvailability类,重写了Cesium.TileAvailability的所有方法,支持在内部自动筛选要使用的地形图层
| Name | Type | Description |
|---|---|---|
layers |
Array.<Object> |
地形图层数组 |
Methods
-
addAvailableTileRange(level, startX, startY, endX, endY)
engineExtensions/core/MapGISTileAvailability.js, line 27 -
Marks a rectangular range of tiles in a particular level as being available. For best performance, add your ranges in order of increasing level.
Name Type Description levelNumber The level.
startXNumber The X coordinate of the first available tiles at the level.
startYNumber The Y coordinate of the first available tiles at the level.
endXNumber The X coordinate of the last available tiles at the level.
endYNumber The Y coordinate of the last available tiles at the level.
-
computeBestAvailableLevelOverRectangle(rectangle){Number}
engineExtensions/core/MapGISTileAvailability.js, line 77 -
Finds the most detailed level that is available everywhere within a given rectangle. More detailed tiles may be available in parts of the rectangle, but not the whole thing. The return value of this function may be safely passed to Cesium.sampleTerrain for any position within the rectangle. This function usually completes in time logarithmic to the number of rectangles added with zondy.cesium.MapGISTileAvailability.addAvailableTileRange()
Name Type Description rectangleCesium.Rectangle The rectangle.
Returns:
Type Description Number The best available level for the entire rectangle. -
computeChildMaskForTile(level, x, y){Number}
engineExtensions/core/MapGISTileAvailability.js, line 126 -
Computes a bit mask indicating which of a tile's four children exist. If a child's bit is set, a tile is available for that child. If it is cleared, the tile is not available. The bit values are as follows:
Bit Position Bit Value Child Tile 0 1 Southwest 1 2 Southeast 2 4 Northwest 3 8 Northeast Name Type Description levelNumber The level of the parent tile.
xNumber The X coordinate of the parent tile.
yNumber The Y coordinate of the parent tile.
Returns:
Type Description Number The bit mask indicating child availability. -
computeMaximumLevelAtPosition(position){Number}
engineExtensions/core/MapGISTileAvailability.js, line 55 -
Determines the level of the most detailed tile covering the position. This function usually completes in time logarithmic to the number of rectangles added with zondy.cesium.MapGISTileAvailability.addAvailableTileRange()
Name Type Description positionCesium.Cartographic The position for which to determine the maximum available level. The height component is ignored.
Throws:
-
If position is outside any tile according to the tiling scheme.
- Type
- Cesium.DeveloperError
Returns:
Type Description Number The level of the most detailed tile covering the position. -
-
isTileAvailable(level, x, y){Boolean}
engineExtensions/core/MapGISTileAvailability.js, line 99 -
Determines if a particular tile is available.
Name Type Description levelNumber The tile level to check.
xNumber The X coordinate of the tile to check.
yNumber The Y coordinate of the tile to check.
Returns:
Type Description Boolean True if the tile is available; otherwise, false.