Class: Range

Range

分段专题图图层源。

new Range(name, opt_options)

Usage
// 浏览器
<script type="text/javascript" src="https://iclient.supermap.io/dist/openlayers/iclient-ol.js"></script>
<script>
  new ol.source.Range(name, opt_options);
  
</script>

// ES6 Import
import { Range } from '@supermap/iclient-ol';

new Range(name, opt_options);

openlayers/overlay/Range.js, line 9
Name Type Description
name string

名称

opt_options Object

参数。

Name Type Default Description
map ol.Map

当前map对象。

themeField string

指定创建专题图字段。

id string 可选

专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。

opacity number 1 可选

图层透明度。

logo string 可选

Logo(openLayers 5.0.0 及更高版本不再支持此参数)。

projection ol.proj.Projection 可选

投影信息。

ratio number 1.5 可选

视图比,1 表示画布是地图视口的大小,2 表示地图视口的宽度和高度的两倍,依此类推。必须是 1 或更高。

resolutions Array 可选

分辨率数组。

state ol.source.State 可选

资源状态。

style Object 可选

专题图样式。

styleGroups Object 可选

各专题类型样式组。

isHoverAble boolean false 可选

是否开启 hover 事件。

highlightStyle Object 可选

开启 hover 事件后,触发的样式风格。

attributions string | Object 'Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>' 可选

版权信息。

Extends

Methods

inherited addFeatures(features)

openlayers/overlay/theme/GeoFeature.js, line 69

添加要素。

Name Type Description
features Array.<ThemeFeature> | Array.<GeoJSONObject> | Array.<ol.Feature> | ThemeFeature | GeoJSONObject | ol.Feature

要素对象。

inherited clear()

openlayers/overlay/theme/GeoFeature.js, line 222

清除的内容包括数据(features)、专题要素、缓存。

inherited clearCache()

openlayers/overlay/theme/GeoFeature.js, line 213

清除缓存。

destroy()

openlayers/overlay/Range.js, line 44

释放资源,将引用资源的属性置空。

inherited getCacheCount(){number}

openlayers/overlay/theme/GeoFeature.js, line 233

获取当前缓存数量。

Returns:
Type Description
number 返回当前缓存数量。

inherited getShapesByFeatureID(featureID){Array}

openlayers/overlay/theme/GeoFeature.js, line 254

通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。

Name Type Description
featureID number

要素 ID。

Returns:
Type Description
Array 返回图形数组。

inherited redrawThematicFeatures(extent)

openlayers/overlay/theme/GeoFeature.js, line 106

重绘所有专题要素。

Name Type Description
extent Object

视图范围数据。

inherited removeAllFeatures()

openlayers/overlay/theme/GeoFeature.js, line 97

清除当前图层所有的矢量要素。

inherited removeFeatures(features)

openlayers/overlay/theme/GeoFeature.js, line 87

从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。

Name Type Description
features Array.<FeatureVector> | FeatureVector | function

待删除的要素对象或用于过滤的回调函数。

inherited setMaxCacheCount(cacheCount)

openlayers/overlay/theme/GeoFeature.js, line 242

设置最大缓存条数。

Name Type Description
cacheCount number

缓存总数。