new ol.source.Theme(name, opt_option)
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | 专题图图层名称。 | ||||||||||||||||||||||||||||||||||||||||
| opt_option | Object | 参数。 
 | 
Extends
Methods
- 
    addFeatures(features)openlayers/overlay/theme/Theme.js, line 178
- 
    
    
    抽象方法,可实例化子类必须实现此方法。向专题图图层中添加数据, 专题图仅接收 SuperMap.Feature.Vector 类型数据, feature 将储存于 features 属性中,其存储形式为数组。 Name Type Description featuresol.supermap.ThemeFeature | GeoJSONObject | ol.Feature 待转要素。 
- 
    addTFEvents()openlayers/overlay/theme/Theme.js, line 432
- 
    
    
    将图层添加到地图上之前用户要求添加的事件监听添加到图层。 
- 
    destroy()openlayers/overlay/theme/Theme.js, line 123
- 
    
    
    释放资源,将引用资源的属性置空。 
- 
    destroyFeatures(features)openlayers/overlay/theme/Theme.js, line 142
- 
    
    
    销毁某个要素。 Name Type Description featuresSuperMap.Feature.Vector 将被销毁的要素。 
- 
    fire(type, event)openlayers/overlay/theme/Theme.js, line 340
- 
    
    
    添加专题要素事件监听。 Name Type Description typestring 事件类型。 eventstring 事件名称。 
- 
    getFeatureBy(property, value){SuperMap.Feature.Vector}openlayers/overlay/theme/Theme.js, line 262
- 
    
    
    在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时, 返回此 feature(并且只返回第一个)。 Name Type Description propertystring feature 的某个属性名称。 valuestring property 所对应的值。 Returns:Type Description SuperMap.Feature.Vector 第一个匹配属性和值的矢量要素。 
- 
    getFeatureById(featureId){SuperMap.Feature.Vector}openlayers/overlay/theme/Theme.js, line 282
- 
    
    
    通过给定一个 ID,返回对应的矢量要素。 Name Type Description featureIdstring 矢量要素的属性 ID。 Returns:Type Description SuperMap.Feature.Vector 对应 ID 的 feature,如果不存在则返回 null。 
- 
    getFeatures(){SuperMap.Feature.Vector}openlayers/overlay/theme/Theme.js, line 247
- 
    
    
    查看当前图层中的有效数据。 Returns:Type Description SuperMap.Feature.Vector 用户加入图层的有效数据。 
- 
    getFeaturesByAttribute(attrName, attrValue){Array.<SuperMap.Feature.Vector>}openlayers/overlay/theme/Theme.js, line 292
- 
    
    
    通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。 Name Type Description attrNamestring 属性的 key。 attrValuestring 矢量要素的属性 ID。 Returns:Type Description Array.<SuperMap.Feature.Vector> 一个匹配的 feature 数组。 
- 
    getLocalXY(coordinate)openlayers/overlay/theme/Theme.js, line 444
- 
    
    
    获取坐标系统。 Name Type Description coordinateObject 坐标位置。 
- 
    on(event, callback)openlayers/overlay/theme/Theme.js, line 322
- 
    
    
    添加专题要素事件监听。支持的事件包括: click、mousedown、mousemove、mouseout、mouseover、mouseup。 Name Type Description eventstring 事件名称。 callbackRequestCallback 事件回调函数。 
- 
    redrawThematicFeatures(extent)openlayers/overlay/theme/Theme.js, line 314
- 
    
    
    抽象方法,可实例化子类必须实现此方法。重绘专题要素。 Name Type Description extentArray 当前级别下计算出的地图范围。 
- 
    removeAllFeatures()openlayers/overlay/theme/Theme.js, line 235
- 
    
    
    清除当前图层所有的矢量要素。 
- 
    removeFeatures(features)openlayers/overlay/theme/Theme.js, line 189
- 
    
    
    从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。 参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature, 如果无法确定 feature 数组,则可以调用 removeAllFeatures 来删除所有 feature。 如果要删除的 feature 数组中的元素特别多,推荐使用 removeAllFeatures, 删除所有 feature 后再重新添加。这样效率会更高。 Name Type Description featuresArray.<SuperMap.Feature.Vector> 要删除 feature 的数组。 
- 
    rotate(pixelP, rotation, center)openlayers/overlay/theme/Theme.js, line 472
- 
    
    
    获取某像素坐标点 pixelP 绕中心 center 逆时针旋转 rotation 弧度后的像素点坐标。 Name Type Description pixelPnumber 像素坐标点位置。 rotationnumber 旋转角度。 centernumber 中心位置。 
- 
    scale(pixelP, center, scaleRatio){Array.<number>}openlayers/overlay/theme/Theme.js, line 485
- 
    
    
    获取某像素坐标点 pixelP 相对于中心 center 进行缩放 scaleRatio 倍后的像素点坐标。 Name Type Description pixelPObject 像素点。 centerObject 中心点。 scaleRationumber 缩放倍数。 Returns:Type Description Array.<number> 返回数组形比例 
- 
    setOpacity(opacity)openlayers/overlay/theme/Theme.js, line 160
- 
    
    
    设置图层的不透明度,取值[0-1]之间。 Name Type Description opacitynumber 不透明度。 
- 
    toFeature(features){SuperMap.Feature.Vector}openlayers/overlay/theme/Theme.js, line 541
- 
    
    
    转为 iClient 要素,该方法将被弃用,由 ol.source.Theme#toiClientFeature 代替。 Name Type Description featuresol.supermap.ThemeFeature | GeoJSONObject | ol.Feature 待转要素。 - Deprecated
- Yes
 
 Returns:Type Description SuperMap.Feature.Vector 转换后的 iClient 要素 
- 
    toiClientFeature(features){SuperMap.Feature.Vector}openlayers/overlay/theme/Theme.js, line 499
- 
    
    
    转为 iClient 要素。 Name Type Description featuresol.supermap.ThemeFeature | GeoJSONObject | ol.Feature 待转要素。 Returns:Type Description SuperMap.Feature.Vector 转换后的 iClient 要素 
- 
    un(event, callback)openlayers/overlay/theme/Theme.js, line 407
- 
    
    
    移除专题要素事件监听。 Name Type Description eventstring 事件名称。 callbackRequestCallback 事件回调函数。