GeoWTFS

new Cesium.GeoWTFS(options)

吉奥三维地名
Name Type Description
options Object optional 参数选项:
Name Type Description
proxy Proxy optional 代理。
viewer Viewer optional 三维球对象。
url String optional WTFS服务地址。
labelGraphics LabelGraphics optional 文本样式
billboardGraphics BillboardGraphics optional 图标样式
aotuCollide Boolean optional 开启避让
collisionPadding Array optional 开启避让时,标注碰撞增加内边距,上、右、下、左
subdomains Array optional 多域名参数,解析模板串中的{s},默认值['a', 'b', 'c']
token String optional 天地图的token
depthTestOptimization Boolean optional 是否开启地名遮挡优化(在地形山脉后面不显示地名)
dTOElevation Number optional 当地名遮挡优化时,相机高度小于多少时触发
dTOPitch Number optional 当地名遮挡优化时,相机俯仰角大于多少时触发, -90到0
version String optional 三维地名服务版本号,默认为1.0.0
dataSetName String optional 三维地名服务的数据集名称
Author:
  • liuck
Example:
var wtfs = new Cesium.GeoWTFS({
		proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
     viewer : viewer,
     url : 'http://172.15.110.3:9010/xz_swdm/wtfs',
     depthTestOptimization: true,
     dTOElevation: 15000,
     dTOPitch: Cesium.Math.toRadians(-70),
     aotuCollide : true,
     collisionPadding: [3,5,3,5], //开启避让时,标注碰撞增加内边距,上、右、下、左
     labelGraphics: {
     	font:"10px sans-serif",
         bold:false,
      	fillColor:Cesium.Color.YELLOW,
      	scale:1,
	        outlineColor:Cesium.Color.YELLOW,
	        outlineWidth:0.1,
	        //style:Cesium.LabelStyle.FILL_AND_OUTLINE,
	        style:Cesium.LabelStyle.FILL,
	        showBackground:false,
	        backgroundColor:Cesium.Color.RED,
	        backgroundPadding:new Cesium.Cartesian2(10, 10),
	        horizontalOrigin:Cesium.HorizontalOrigin.LEFT,
	        verticalOrigin:Cesium.VerticalOrigin.TOP,
	        eyeOffset:Cesium.Cartesian3.ZERO,
			//pixelOffset:Cesium.Cartesian2.ZERO,
	        pixelOffset:new Cesium.Cartesian2(8, 8),
         disableDepthTestDistance:undefined,
         heightReference: Cesium.HeightReference.NONE,
         scaleByDistance: new Cesium.NearFarScalar(200,1,10000,0.0)
		},
		billboardGraphics: {
	        horizontalOrigin:Cesium.HorizontalOrigin.CENTER, 
	        verticalOrigin:Cesium.VerticalOrigin.CENTER,
	        eyeOffset:Cesium.Cartesian3.ZERO,
	        pixelOffset:Cesium.Cartesian2.ZERO,
	        alignedAxis:Cesium.Cartesian3.ZERO,
	        color:Cesium.Color.WHITE,
	        rotation:0,
	        scale:1,
	        width:15,
	        height:15,
         disableDepthTestDistance:undefined,
         heightReference: Cesium.HeightReference.NONE,
         scaleByDistance: new Cesium.NearFarScalar(200,1,10000,0.0)
		}
});

Methods

activate()

强制激活

clearLabels()

将地图中的地名清空

destroy()

销毁。

getCacheLabel(oid)object

从缓存中获取标注
Name Type Description
oid String OID
Returns:
label - 标注对象

getCacheTile(x, y, z, t)object

从缓存中获取地名瓦片
Name Type Description
x Number X
y Number Y
z Number Z
t Number T
Returns:
tile - 地名瓦片

getIcoImg(id)Canvas

获取3.0.0版本的标注图标的图片
Name Type Description
id String 雪碧图的id
Returns:

getIcoUrl()String

获取图标URL完整模板串
Returns:
url

getRoadTileUrl()String

获取道路瓦片URL完整模板串
Returns:
url

getSpriteUrl(format, extension)String

获取3.0.0版本的雪碧图URL完整模板串
Name Type Description
format String 格式,'@2x'或''
extension String 扩展名,'.json'或'.png'
Returns:
url

getStyleUrl()String

获取3.0.0版本的样式URL完整模板串
Returns:
url

getTileUrl()String

获取瓦片URL完整模板串
Returns:
url

hide()

隐藏地名

initTDT()

天地图地名手动加载,限初始的加速显示
Example:
geoWTFS.initTDT([{"x":6,"y":1,"level":2,"boundBox":{"minX":90,"minY":0,"maxX":135,"maxY":45}},{"x":7,"y":1,"level":2,"boundBox":{"minX":135,"minY":0,"maxX":180,"maxY":45}},{"x":6,"y":0,"level":2,"boundBox":{"minX":90,"minY":45,"maxX":135,"maxY":90}},{"x":7,"y":0,"level":2,"boundBox":{"minX":135,"minY":45,"maxX":180,"maxY":90}},{"x":5,"y":1,"level":2,"boundBox":{"minX":45,"minY":0,"maxX":90,"maxY":45}},{"x":4,"y":1,"level":2,"boundBox":{"minX":0,"minY":0,"maxX":45,"maxY":45}},{"x":5,"y":0,"level":2,"boundBox":{"minX":45,"minY":45,"maxX":90,"maxY":90}},{"x":4,"y":0,"level":2,"boundBox":{"minX":0,"minY":45,"maxX":45,"maxY":90}},{"x":6,"y":2,"level":2,"boundBox":{"minX":90,"minY":-45,"maxX":135,"maxY":0}},{"x":6,"y":3,"level":2,"boundBox":{"minX":90,"minY":-90,"maxX":135,"maxY":-45}},{"x":7,"y":2,"level":2,"boundBox":{"minX":135,"minY":-45,"maxX":180,"maxY":0}},{"x":5,"y":2,"level":2,"boundBox":{"minX":45,"minY":-45,"maxX":90,"maxY":0}},{"x":4,"y":2,"level":2,"boundBox":{"minX":0,"minY":-45,"maxX":45,"maxY":0}},{"x":3,"y":1,"level":2,"boundBox":{"minX":-45,"minY":0,"maxX":0,"maxY":45}},{"x":3,"y":0,"level":2,"boundBox":{"minX":-45,"minY":45,"maxX":0,"maxY":90}},{"x":2,"y":0,"level":2,"boundBox":{"minX":-90,"minY":45,"maxX":-45,"maxY":90}},{"x":0,"y":1,"level":2,"boundBox":{"minX":-180,"minY":0,"maxX":-135,"maxY":45}},{"x":1,"y":0,"level":2,"boundBox":{"minX":-135,"minY":45,"maxX":-90,"maxY":90}},{"x":0,"y":0,"level":2,"boundBox":{"minX":-180,"minY":45,"maxX":-135,"maxY":90}}])

show()

显示地名