Map

.TileMap. Map

平面地球管理

Constructor

new Glodon.Bimface.Plugins.TileMap.Map(mapConfig)

Parameters:
Name Type Description
mapConfig Glodon.Bimface.Plugins.TileMap.MapConfig

Map配置项

Methods

addEventListener(event, callback)

新增监听事件

Parameters:
Name Type Description
event Glodon.Bimface.Plugins.TileMap.MapEvent

地图监听事件

callback function

回调函数

addExcavationRegion(id, points)

根据多个点创建开挖区域

Parameters:
Name Type Description
id String

开挖区域ID

points Array

三维点对象列表

addFlattenRegion(id, points, elevation)

根据多个点及标高将指定区域拍平

Parameters:
Name Type Description
id String

拍平区域ID

points Array

三维点对象列表

elevation Number

拍平区域高程,缺省值为0

addMap(source)

增加新的影像数据

Parameters:
Name Type Description
source Object

设置地图资源的配置项

Properties
Name Type Description
url String

地图资源的url

provider String

地图资源的协议

hasTileMapResource Boolean

是否存在配置文件等,QGIS工具切出的影像需要设置为true

addRoad()

增加路网

Returns:
Type Description
Object

路网图层

clearExcavationRegions()

清空所有开挖区域

clearFlattenRegions()

清空所有拍平区域

destroy()

销毁地图

getBasePoint()

获取模型基准点

Returns:
Type Description
Object

模型与地图对齐与旋转的基准点

getMapSource()

获取地图资源

Returns:
Type Description
Object

地图资源

getMapStyle()

获取地图的滤镜颜色

Returns:
Type Description
Object

滤镜颜色样式,如{“template”:Glodon.Bimface.Common.ImageStyle.DarkBlue}

getMaxLevel()

获取当前设置的地图服务请求的最大层级

Returns:
Type Description
Number

地图服务请求的最大层级

getModelAltitude()

获取模型海拔位置

Returns:
Type Description
Number

模型零零标高对应的海拔,单位为米

getModelPosition()

获取模型经纬度

Returns:
Type Description
Array

经纬度坐标,采用WGS84坐标系

getModelRotationZ()

获取模型旋转值

Returns:
Type Description
Number

模型旋转值

getOpacity()

获取影像的不透明度

Returns:
Type Description
Number

影像的不透明度

hide()

隐藏地图

hideExcavationRegionsById(ids)

根据ID列表隐藏开挖区域

Parameters:
Name Type Description
ids Array

开挖区域ID列表

lngLatToWorldPosition(lngLat, callback)

将GCJ02经纬度坐标转为场景内的世界坐标

Parameters:
Name Type Description
lngLat Array

经纬度,经度取值为[-180, 180],纬度取值为[-85.05, 85.05]

callback function

回调函数,参数为三维世界坐标

Returns:
Type Description
Object

世界坐标

removeEventListener(event, callback)

移除监听事件

Parameters:
Name Type Description
event Glodon.Bimface.Plugins.TileMap.MapEvent

地图监听事件

callback function

回调函数

removeExcavationRegionsById(ids)

根据ID列表移除开挖区域

Parameters:
Name Type Description
ids Array

开挖区域ID列表

removeFlattenRegionsById(ids)

根据ID列表移除拍平区域

Parameters:
Name Type Description
ids Array

拍平区域ID列表

removeMap(layer)

移除叠加的地图影像

Parameters:
Name Type Description
layer Object

影像数据

removeRoad()

移除路网

restoreMapStyle()

恢复地图默认显示颜色

setMapSource(source)

设置地图资源

Parameters:
Name Type Description
source Object

设置地图资源

Properties
Name Type Description
url String

地图资源服务

credit Glodon.Bimface.Common.Credit

版权协议信息

text String

选填,当credit为Glodon.Bimface.Common.Credit.Custom时生效,协议链接的显示文本

link String

选填,当credit为Glodon.Bimface.Common.Credit.Custom时生效,协议链接

copyright String

选填,当credit为Glodon.Bimface.Common.Credit.Custom时生效,版权信息的描述文本

provider String

地图瓦片切分方式,可选“GoogleTile”、“TMS”、“BingMap”、“Tianditu”、“Tencent”。

key String

选填,地图资源对应的key

setMapStyle(mapStyle)

设置地图的滤镜颜色

Parameters:
Name Type Description
mapStyle Object

地图滤镜样式, 如{"template": Glodon.Bimface.Common.ImageStyle.DarkBlue}

Properties
Name Type Description
template Glodon.Bimface.Common.ImageStyle

图片滤镜样式

color Glodon.Web.Graphics.Color

选填, 当template为Glodon.Bimface.Common.ImageStyle.CustomColor时必填. 用户自定义滤镜颜色

brightness Number

选填, 亮度, 默认值为0, 取值范围[-1, 1]

contrast Number

选填, 对比度, 默认值为0, 取值范围[-1, 1]

saturation Number

选填, 饱和度, 默认值为0, 取值范围[-1, 1]

setMaxLevel(maxLevel)

设置地图服务请求的最大层级

Parameters:
Name Type Description
maxLevel Number

地图服务请求的最大层级

setModelAltitude(altitude)

设置模型海拔位置

Parameters:
Name Type Description
altitude Number

模型零零标高对应的海拔,单位为米

setModelPosition(radian)

设置模型经纬度

Parameters:
Name Type Description
radian Array

经纬度坐标,采用WGS84坐标系

setModelRotationZ(radian)

设置模型旋转值

Parameters:
Name Type Description
radian Number

模型旋转值,以逆时针旋转为正,单位为弧度

setOpacity(opacity)

设置影像的不透明度[0.0,1.0]

Parameters:
Name Type Description
opacity Number

影像的不透明度

show()

显示地图

showExcavationRegionsById(ids)

根据ID列表显示开挖区域

Parameters:
Name Type Description
ids Array

开挖区域ID列表

worldPositionToLngLat(worldPosition)

将场景内的世界坐标转为GCJ02经纬度坐标

Parameters:
Name Type Description
worldPosition Object

三维世界坐标

Returns:
Type Description
Array

经纬度坐标