CustomWebMercatorTilingScheme

new Cesium.CustomWebMercatorTilingScheme(options)

自定义投影瓦片方案。适用于墨卡托投影和高斯投影等投影下的平面坐标的地图服务。
Name Type Description
options Object optional 参数选项:
Name Type Description
resolutions Array optional 地图服务每级分辨率
origin Array optional 地图服务原点(左上角)
fullExtent Array optional 有数据的地理范围
matrixWidth Number optional 第一级别的matrixWidth值
matrixHeight Number optional 第一级别的matrixHeight值
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

readonlycenterPoint : Array

图幅的中心点

readonlydataRectangle : Rectangle

有数据的地理范围

readonlyellipsoid : Ellipsoid

椭球

readonlymaximumLevel : Number

请求服务的最大级别

readonlyprojection : WebMercatorProjection

投影

readonlyproposalHeight : Number

定位到地图合适区域的相机高度

readonlyrectangle : Rectangle

图幅范围

readonlytopTileExtent : Array

图幅范围

Methods

getNumberOfXTilesAtLevel(level)Number

获取在指定层级级别下的x方向的瓦片数量
Name Type Description
level Number 层级级别
Returns:
瓦片数量

getNumberOfYTilesAtLevel(level)Number

获取在指定层级级别下的y方向的瓦片数量
Name Type Description
level Number 层级级别
Returns:
瓦片数量