SMap.GroundImage
目录 |
说明
- 地图的背景图,图片在地图上会随着地图的缩放而缩放,此类继承自SMap.Overlay。
构造函数
SMap.GroundImage(lnglat:LngLat,option:SMap.GroundImageOptions)
- 通过由左上、右下角组成的经纬度数组和参数选项构建矩形对象。
参数
- lnglat:LngLat GroundImage左上角经纬度坐标。
- option:SMap.GroundImageOptions 参数选项,参见GroundImageOptions。
注释
- 图片在放大和缩小时会失真。
示例
var opt = new SMap.GroundImageOptions(); opt.imageUrl = "图片url"; opt.originalLevel =10; var lnglat = new SMap.LngLat("116.305355","39.9823278",1); var img = new SMap.GroundImage(lnglat,opt); mapObj.addOverlay(img,true);
属性
id:String
- 对象编号,也是对象的唯一标识。
TYPE:SMap.Constant
- 覆盖物的类型。
取值
- SMap.Overlay.TYPE_GROUNDIMAGE
lnglat:SMap.LngLat
- 图片左上角经纬度坐标。
option:SMap.GroundImageOptions
- 参数选项,参照GroundImageOptions。
size:SMap.Size
- 地图背景的尺寸大小,对应于Size类,单位为像素。
注释
- 获取宽高数值前要先调用getOverlayById()方法得到GroundImage对象。
bounds:SMap.LngLatBounds
- 地图背景所处的经纬度坐标范围,对应于LngLatBounds类。
注释
- 获取bounds前要先调用getOverlayById()方法得到GroundImage对象。
文档更新时间: 2011-03-22