(data, layer, style, options, shapeOptions)
| 44 | export class ThemeVector extends Theme { |
| 45 | |
| 46 | constructor(data, layer, style, options, shapeOptions) { |
| 47 | super(data, layer); |
| 48 | //数据的 geometry 属性必须存在且类型是 Geometry 或其子类的类型 |
| 49 | if (!data.geometry) { |
| 50 | return; |
| 51 | } |
| 52 | if (!(data.geometry instanceof Geometry)) { |
| 53 | return; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * @member {Bounds} [FeatureThemeVector.prototype.dataBounds] |
| 58 | * @description 用户数据的(feature.geometry)地理范围。 |
| 59 | */ |
| 60 | this.dataBounds = data.geometry.getBounds(); |
| 61 | |
| 62 | /** |
| 63 | * @member {number} [FeatureThemeVector.prototype.nodesClipPixel=2] |
| 64 | * @description 节点抽稀像素距离。 |
| 65 | */ |
| 66 | this.nodesClipPixel = 2; |
| 67 | |
| 68 | /** |
| 69 | * @member {boolean} [FeatureThemeVector.prototype.isHoverAble=true] |
| 70 | * @description 图形是否可 hover。 |
| 71 | */ |
| 72 | this.isHoverAble = true; |
| 73 | |
| 74 | /** |
| 75 | * @member {boolean} [FeatureThemeVector.prototype.isMultiHover=true] |
| 76 | * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。 |
| 77 | */ |
| 78 | this.isMultiHover = true; |
| 79 | |
| 80 | /** |
| 81 | * @member {boolean} [FeatureThemeVector.prototype.isClickAble=true] |
| 82 | * @description 图形是否可点击。 |
| 83 | */ |
| 84 | this.isClickAble = true; |
| 85 | |
| 86 | /** |
| 87 | * @member {Object} [FeatureThemeVector.prototype.highlightStyle] |
| 88 | * @description 高亮样式。 |
| 89 | */ |
| 90 | this.highlightStyle = null; |
| 91 | |
| 92 | /** |
| 93 | * @member {Object} [FeatureThemeVector.prototype.shapeOptions] |
| 94 | * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。 |
| 95 | */ |
| 96 | this.shapeOptions = {}; |
| 97 | |
| 98 | /** |
| 99 | * @member {Object} [FeatureThemeVector.prototype.style] |
| 100 | * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。 |
| 101 | */ |
| 102 | this.style = style || {}; |
| 103 |
nothing calls this directly
no test coverage detected