Skip to content

Commit

Permalink
fix(bmap): 修复地图组件数据响应问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiguaxigua committed Jun 16, 2018
1 parent 561117c commit 4b3c420
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions examples/pages/bmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
:settings="chartSettings"
:series="chartSeries"
:after-set-option-once="getMap"
:set-option-opts="false"
:mark-line="markLine">
</ve-bmap>
<button @click="markLine = {}">toggle</button>
<button @click="add">add</button>
</div>
</template>

Expand All @@ -33,7 +33,8 @@ export default {
type: 'scatter',
coordinateSystem: 'bmap',
data: [
[120, 30, 1]
[120, 30.0000001, 5],
[120, 30.0000002, 5]
]
}
],
Expand All @@ -45,6 +46,10 @@ export default {
getMap (echarts) {
const bmap = echarts.getModel().getComponent('bmap').getBMap()
bmap.addControl(new window.BMap.MapTypeControl())
},
add () {
this.chartSeries[0].data.push([120, 30.2, 1])
}
},
Expand Down
4 changes: 3 additions & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ export default {
}

if (this.afterConfig) options = this.afterConfig(options)
this.echarts.setOption(options, this.setOptionOpts)
let setOptionOpts = this.setOptionOpts
if (this.settings.bmap || this.settings.amap) setOptionOpts = false
this.echarts.setOption(options, setOptionOpts)
this.$emit('ready', this.echarts)
if (!this._once['ready-once']) {
this._once['ready-once'] = true
Expand Down

0 comments on commit 4b3c420

Please sign in to comment.