MapSdk()

Class description

new MapSdk()

sdk

Classes

MapSdk

sdk

Members

featuresGeometry

features的像素信息在运行时保存的(目的:不用请求接口获取)

featuresLayerInfo

features的图层信息在运行时保存的(目的:不用请求接口获取)

static featuresGeometry :Array.<any>

features的像素信息在运行时保存的(目的:不用请求接口获取)

static featuresLayerInfo :Array.<any>

features的图层信息在运行时保存的(目的:不用请求接口获取)

Methods

static CompareImage(left, right, additionLayer)

卷帘
Parameters:
Name Type Description
left Image 左侧显示的Image实例
right Image 右侧显示的Image实例
additionLayer Array.<any> 额外在左右两侧地图上都需要加的图层
Tutorials:
  • Tutorial: Map

static addLayer(image, visParamsopt, nameopt, visibleopt) → {String}

在地图上添加图层,图层类型可以是Image、Geometry、Feature、FeatureCollection,返回图层唯一的ID
Parameters:
Name Type Attributes Description
image Image | Geometry | Feature | FeatureCollection 作为图层添加的图像数据
visParams Object <optional>
可选参数,属性:style(应用到图层的样式),palette(用于图层的调色板), crop(WKT类型的Geometry对象或gpkg文件路径),min, max, gamma, brightness
name String <optional>
可选参数,给予图层的名称。
visible Boolean <optional>
可选参数,该图层是否可见,默认为true
Returns:
String - 添加图层的Id
Tutorials:
  • Tutorial: Map

static addUI(ui)

在地图上添加自定义ui
Parameters:
Name Type Description
ui Widget 自定义ui
Tutorials:
  • Tutorial: Map

async, static centerObject(object, zoomopt)

相机飞入到指定图层位置
Parameters:
Name Type Attributes Description
object Object 图层对象
zoom Number <optional>
地图显示缩放级别(0-24)

static clear(paramopt)

清空已添加的所有图层
Parameters:
Name Type Attributes Description
param String <optional>
影像的url
Tutorials:
  • Tutorial: Map

static clearCurrent(paramopt)

清空已添加的所有图层, no onLoadCompleted
Parameters:
Name Type Attributes Description
param String <optional>
影像的url
Tutorials:
  • Tutorial: Map

static flyto(param)

相机飞入到制定图层位置
Parameters:
Name Type Description
param String | Array.<number> 图层的Id
Tutorials:
  • Tutorial: Map

static getBounds(asGeoJSON)

返回地图视图的地理边界
Parameters:
Name Type Description
asGeoJSON boolean optional 如果asGeoJSON为true,则返回GeoJSON格式的边界
Returns:
- GeoJSONGeometry|Array|String
Tutorials:
  • Tutorial: Map

static getCenter()

返回地图视图的地理中心
Returns:
- Geometry.Point
Tutorials:
  • Tutorial: Map

static getScale()

返回当前地图视图的近似像素比例,单位为米
Returns:
- number
Tutorials:
  • Tutorial: Map

static getZoom()

返回地图视图的当前缩放级别
Returns:
- number
Tutorials:
  • Tutorial: Map

static removeLayer(Id)

根据提供的ID移除图层
Parameters:
Name Type Description
Id String 待删除图层的ID
Tutorials:
  • Tutorial: Map

static removeUI(ui)

移除地图上的自定义ui
Parameters:
Name Type Description
ui Widget 自定义ui
Tutorials:
  • Tutorial: Map

static setCenter(lon, lat, zoomopt)

设置地图中心显示
Parameters:
Name Type Attributes Description
lon Number 地图显示中心点的经度
lat Number 地图显示中心点的经度
zoom Number <optional>
可选参数,地图显示缩放级别(0-24)
Tutorials:
  • Tutorial: Map

static setFilter(id, classId)

图层过滤显示
Parameters:
Name Type Description
id String 图层的id
classId String 过滤的图层类别

static setOptions(mapTypeId)

修改地图底图
Parameters:
Name Type Description
mapTypeId String 可以是 "SATELLITE"、"ROADMAP" 或 "TERRAIN" 之一
Tutorials:
  • Tutorial: Map

static setZoom(zoom)

设置地图显示缩放级别
Parameters:
Name Type Description
zoom Number 地图显示缩放级别(0-24)
Tutorials:
  • Tutorial: Map

static zoomIn()

放大地图
Tutorials:
  • Tutorial: Map

static zoomOut()

缩小地图
Tutorials:
  • Tutorial: Map