自定义投影瓦片方案。适用于墨卡托投影和高斯投影等投影下的平面坐标的地图服务。
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
optional
参数选项:
|
Example:
//初始化三维球
var viewer = new Cesium.Map("cesiumContainer");
var customWebMercatorTilingScheme = new Cesium.CustomWebMercatorTilingScheme({
resolutions: [152.874056570352,76.4370282851761,38.218514142588,19.109257071294,9.55462853564701,4.77731426782351,2.38865713391175,1.1943285669558803,0.5971642834779401],
origin: [-2.00375083427892E7, 2.00375083427892E7],
fullExtent: [305238.82092285156, 2881713.2728881836, 433836.10748291016, 3032092.984680176],
matrixWidth: 524,
matrixHeight: 439
});
var urlTemplateImageryProvider = new Cesium.UrlTemplateImageryProvider({
url: new Cesium.Resource({
proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
url: "http://192.168.100.224:6080/arcgis/rest/services/beijing1954/GY_JCDL_GYDT_XZQH/MapServer/tile/{z}/{y}/{x}"
}),
tilingScheme: customWebMercatorTilingScheme,
maximumLevel: customWebMercatorTilingScheme.maximumLevel,
rectangle: customWebMercatorTilingScheme.dataRectangle
});
viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider);
//以WMTS的方式添加方式添加
var wmts = new Cesium.WebMapTileServiceImageryProvider({
url: 'http://192.168.100.224:6080/arcgis/rest/services/beijing1954/GY_JCDL_GYDT_XZQH/MapServer/WMTS?',
layer: 'beijing1954_GY_JCDL_GYDT_XZQH',
style: 'default',
tileMatrixSetID: 'default028mm',
format: 'image/png',
tilingScheme: customWebMercatorTilingScheme,
maximumLevel: customWebMercatorTilingScheme.maximumLevel,
rectangle: customWebMercatorTilingScheme.dataRectangle
});
viewer.imageryLayers.addImageryProvider(wmts);
Demo:
Members
图幅的中心点
有数据的地理范围
椭球
请求服务的最大级别
投影
定位到地图合适区域的相机高度
图幅范围
图幅范围
Methods
获取在指定层级级别下的x方向的瓦片数量
Name | Type | Description |
---|---|---|
level |
Number | 层级级别 |
Returns:
瓦片数量
获取在指定层级级别下的y方向的瓦片数量
Name | Type | Description |
---|---|---|
level |
Number | 层级级别 |
Returns:
瓦片数量