new Util()
utils/Util.js, line 37
Classes
Methods
-
staticUtil.calculateExtent(points){Array}
utils/Util.js, line 324 -
根据坐标串数组计算其矩形边界坐标
Name Type Description pointsArray 坐标串数组
[[lng1,lat1],[lng2,lat2],...]Returns:
Type Description Array 边界坐标数组 [xMin, yMin, xMax, yMax] -
staticUtil.calculateExtentCenter(points){Array}
utils/Util.js, line 347 -
根据坐标串数组计算其几何中心
Name Type Description pointsArray 坐标串数组
[[lng1,lat1],[lng2,lat2],...]Returns:
Type Description Array 几何中心坐标 -
staticUtil.clipLayer(layer, bounds, map)
utils/Util.js, line 103 -
使用指定的边界坐标裁剪图层
Name Type Description layerLayer 需要裁剪的图层对象,注意如果图层没有指定className,则会裁切所有默认className的图层
boundsArray 指定裁剪的边界坐标,
[[lng1, lat1], [lng2, lat2]...]mapMap 图层所在的map对象
-
staticUtil.defineBaiduProjection(){Projection}
utils/Util.js, line 142 -
自定义百度坐标系,其中包含百度经纬度和百度墨卡托
Returns:
Type Description Projection projection 新百度坐标系 -
staticUtil.defineProjection(projCode, proj4def){proj}
utils/Util.js, line 129 -
自定义坐标系
Name Type Description projCodeString // 查找坐标系定义得到 http://epsg.io/ ,如:"EPSG:4490"
proj4defString // 查找坐标系定义得到 http://epsg.io/,如: "+proj=longlat +ellps=GRS80 +no_defs"
Returns:
Type Description proj projection 新坐标系 -
staticUtil.getAMapAPI(plugin, ak){Promise.<AMap>}
utils/Util.js, line 215 -
获取高德API
Name Type Default Description pluginString "AMap.CitySearch,AMap.Geolocation" optional 高德地图插件
akString 6972df398c90eb2344b101589ddf718d 高德Web端开发秘钥,有默认值
Returns:
Type Description Promise.<AMap> 返回AMap对象 -
staticUtil.getBMapAPI(ak){Promise.<BMap>}
utils/Util.js, line 186 -
获取百度API
Name Type Default Description akString sDgF8hpW3e91kCBkKxb1l4rHSOuOoqXg 百度API开发秘钥
Returns:
Type Description Promise.<BMap> 返回BMap对象 -
staticUtil.getDistance(c1, c2, opt_radius){number}
utils/Util.js, line 300 -
根据两个地理坐标求取大圆距离(单位:米)
Name Type Description c1Array 起点
c2Array 终点
opt_radiusnumber 使用的大圆半径 默认使用WGS84椭球体的平均半径
Returns:
Type Description number 返回两点的大圆距离 (单位:米). -
staticUtil.getTMapAPI(tk){Promise.<TMap>}
utils/Util.js, line 246 -
获取天地图API
Name Type Default Description tkString fc499b3b4c71b6e0495ae7b3f98f337e 天地图API开发秘钥,有默认值
Returns:
Type Description Promise.<TMap> 返回TMap对象 -
staticUtil.idw_GridFeatureCollection(lngs, lats, values, options){geojson}
utils/Util.js, line 76 -
使用反距离插值算法生成格点数据,用于绘制等值面
Name Type Description lngsArray 经度数组
latsArray 纬度数组
valuesArray 数值数组
optionsObject 其他可选属性
Name Type Default Description extentArray 网格范围
[xMin,yMin,xMax,yMax]divideNumber 190 optional xy 方向切分网格数
countNumber 12 optional 插值点数/按距离插值时作为最小点数
radiusNumber optional 插值距离,传值就采用按距离插值
Returns:
Type Description geojson 格点数据 -
staticUtil.loadJS(src, callback)
utils/Util.js, line 273 -
异步加载一个js文件/js API
Name Type Description srcString js资源路径
callbackfunction js资源加载完的回调函数
-
staticUtil.setFeatureStyle(feature, options)
utils/Util.js, line 360 -
设置要素的样式
Name Type Description featureFeature 要素
optionsObject 样式参数
Name Type Description strokestrokeOptions 边界样式
fillFillOptions 填充样式