new ol.supermap.Util()
openlayers/core/Util.js, line 23
Methods
-
ol.supermap.Util.createCanvasContext2D(opt_width, opt_height)
openlayers/core/Util.js, line 260 -
创建 2D 画布。
Name Type Description opt_widthnumber 画布宽度。
opt_heightnumber 画布高度。
-
ol.supermap.Util.Csv2GeoJSON(csv, options)
openlayers/core/Util.js, line 172 -
将 csv 格式转为 GeoJSON。
Name Type Description csvObject csv 对象。
optionsObject 转换参数。
-
ol.supermap.Util.getFeatureBySQL(url, datasetNames, serviceOptions, processCompleted, processFaild, targetEpsgCode)
openlayers/core/Util.js, line 344 -
获取feature
Name Type Description urlstring 获取feature的请求地址
datasetNamesstring 数据集名称
serviceOptionsobject 服务类需要的参数
processCompletedfunction 成功请求的回调函数
processFaildfunction 失败请求的回调函数
targetEpsgCodestring | number 动态投影的目标坐标系对应的 EPSG Code
-
ol.supermap.Util.getFeatureProperties(features){array}
openlayers/core/Util.js, line 417 -
从feature中获取properties
Name Type Description featuresarray 要素数组
Returns:
Type Description array 属性 -
ol.supermap.Util.getHighestMatchAdministration(featureName, fieldName){boolean}
openlayers/core/Util.js, line 452 -
Name Type Description featureNamestring 初始匹配的要素数组
fieldNamestring 要匹配的地名
Returns:
Type Description boolean 是否匹配 -
ol.supermap.Util.isArray(obj){boolean}
openlayers/core/Util.js, line 162 -
判断是否为数组格式。
Name Type Description objObject 待判断对象。
Returns:
Type Description boolean 是否是数组。 -
ol.supermap.Util.isMatchAdministrativeName(featureName, fieldName){boolean}
openlayers/core/Util.js, line 434 -
Name Type Description featureNamestring 原始数据中的地名
fieldNamestring 需要匹配的地名
Returns:
Type Description boolean 是否匹配 -
ol.supermap.Util.isNumber(value){boolean}
openlayers/core/Util.js, line 328 -
检测数据是否为number
Name Type Description valuestring 值,未知数据类型
Returns:
Type Description boolean -
ol.supermap.Util.isObject(obj){boolean}
openlayers/core/Util.js, line 294 -
是否为对象
Name Type Description objany 需要判断的内容
Returns:
Type Description boolean -
ol.supermap.Util.isString(str){boolean}
openlayers/core/Util.js, line 285 -
是否为字符串
Name Type Description strstring 需要判断的内容
Returns:
Type Description boolean -
ol.supermap.Util.newGuid(attr){string}
openlayers/core/Util.js, line 313 -
随机生成id
Name Type Description attrstring 几位数字的id
Returns:
Type Description string -
ol.supermap.Util.resolutionToScale(resolution, dpi, mapUnit){number}
openlayers/core/Util.js, line 71 -
通过分辨率计算比例尺。
Name Type Description resolutionnumber 分辨率。
dpinumber 屏幕分辨率。
mapUnitstring 地图单位。
Returns:
Type Description number 比例尺。 -
ol.supermap.Util.scaleToResolution(scale, dpi, mapUnit){number}
openlayers/core/Util.js, line 120 -
通过比例尺计算分辨率。
Name Type Description scalenumber 比例尺。
dpinumber 屏幕分辨率。
mapUnitstring 地图单位。
Returns:
Type Description number 分辨率。 -
ol.supermap.Util.setMask(layers, polygon)
openlayers/core/Util.js, line 479 -
为图层设置掩膜。
Name Type Description layersol/layer/Layer | Array.<ol/layer/Layer> 图层
polygonol/geom/Geometry | ol/feature 掩膜矢量要素,支持面类型的要素。
- Version:
- 10.1.0
-
ol.supermap.Util.supportWebGL2()
openlayers/core/Util.js, line 276 -
是否支持 webgl2。
-
ol.supermap.Util.toGeoJSON(smObj)
openlayers/core/Util.js, line 46 -
将传入对象转为 GeoJSON 格式。
Name Type Description smObjObject 待转参数。
-
ol.supermap.Util.toProcessingParam(points)
openlayers/core/Util.js, line 97 -
将 Region 节点数组转为 Processing 服务需要的分析参数。
Name Type Description pointsArray Region 各个节点数组。
Returns:
processing 服务裁剪、查询分析的分析参数。 -
ol.supermap.Util.toSuperMapBounds(bounds){SuperMap.Bounds}
openlayers/core/Util.js, line 87 -
转为 SuperMapBounds 格式。
Name Type Description boundsArray.<number> bounds 数组。
Returns:
Type Description SuperMap.Bounds 返回 SuperMap 的 Bounds 对象。 -
ol.supermap.Util.toSuperMapGeometry(geoJSON)
openlayers/core/Util.js, line 58 -
将 GeoJSON 对象转为 SuperMap 几何图形。
Name Type Description geoJSONGeoJSONObject GeoJSON 对象。
-
ol.supermap.Util.trim(str){boolean}
openlayers/core/Util.js, line 304 -
字符串裁剪两边的空格
Name Type Description strstring 需要裁剪的字符串
Returns:
Type Description boolean -
ol.supermap.Util.unsetMask(layers)
openlayers/core/Util.js, line 528 -
取消图层掩膜。
Name Type Description layersol/layer/Layer | Array.<ol/layer/Layer> 图层
- Version:
- 10.1.0