new BaseLayer(options)
- Source:
初始化
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | 参数 Properties
|
Methods
addLayer(json)
- Source:
增加图层
Parameters:
| Name | Type | Description |
|---|---|---|
json |
JSON | json数据 |
addSource(data)
- Source:
增加数据
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | source数据 |
buildHoverEvent()
- Source:
构造高亮事件
buildLayer(id, style, isHover) → {Object}
- Source:
构造图层
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
id |
String | 唯一标识 |
|
style |
Object | 样式Object |
|
isHover |
boolean |
false
|
是否为选中样式图层 |
Returns:
- Type
- Object
buildSize(arr, min, max)
- Source:
创建线性控制style样式
Parameters:
| Name | Type | Description |
|---|---|---|
arr |
Array | 数据 |
min |
Number | 最大值 |
max |
Number | 最小值 |
cancelHoverEvent()
- Source:
取消图层的hover监听
dispose()
- Source:
销毁
getFeatureById(id) → {Object|null}
- Source:
获取数据
Parameters:
| Name | Type | Description |
|---|---|---|
id |
String | 唯一标识 |
Returns:
- Type
- Object | null
getFeaturesByProperty(key, value) → {Array}
- Source:
根据属性获取数据
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | 属性 |
value |
String | 值 |
Returns:
- Type
- Array
getId() → {string}
- Source:
获取id
Returns:
id
- Type
- string
getLayer() → {layer}
- Source:
获取图层
Returns:
layer 图层
- Type
- layer
getMap() → {Map|null}
- Source:
获取map对象
Returns:
- Type
- Map | null
getSerie() → {undefined|*}
- Source:
获取serie对象
Returns:
serie
- Type
- undefined | *
getSource() → {Source}
- Source:
获取数据
Returns:
source 数据源
- Type
- Source
getUrl() → {String}
- Source:
获取url地址
Returns:
url 地址
- Type
- String
hide()
- Source:
隐藏图层
init(serie)
- Source:
初始化
Parameters:
| Name | Type | Description |
|---|---|---|
serie |
Object | 数据对象 |
off(type, listener)
- Source:
移除注册事件
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String | 类型 |
listener |
requestCallback | 监听方法 |
on(type, listener)
- Source:
注册事件
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String | 类型 |
listener |
requestCallback | 监听方法 |
setSource(data)
- Source:
设置数据
Parameters:
| Name | Type | Description |
|---|---|---|
data |
JSON | 数据源 |
setUrl(url)
- Source:
设置Url地址
Parameters:
| Name | Type | Description |
|---|---|---|
url |
String | 地址 |
show()
- Source:
显示图层
update(serie)
- Source:
更新数据
Parameters:
| Name | Type | Description |
|---|---|---|
serie |
* | 数据 |