提交 559fc730 编写于 作者: L lang

Map fill data fix when new set option has no mapType

上级 0c6256f9
...@@ -49,7 +49,7 @@ define(function (require) { ...@@ -49,7 +49,7 @@ define(function (require) {
init: function (option) { init: function (option) {
option = this._fillOption(option); option = this._fillOption(option, option.map);
this.option = option; this.option = option;
MapSeries.superApply(this, 'init', arguments); MapSeries.superApply(this, 'init', arguments);
...@@ -68,18 +68,20 @@ define(function (require) { ...@@ -68,18 +68,20 @@ define(function (require) {
}, },
mergeOption: function (newOption) { mergeOption: function (newOption) {
newOption = this._fillOption(newOption); if (newOption.data) {
newOption = this._fillOption(newOption, this.option.map);
}
MapSeries.superCall(this, 'mergeOption', newOption); MapSeries.superCall(this, 'mergeOption', newOption);
this.updateSelectedMap(); this.updateSelectedMap();
}, },
_fillOption: function (option) { _fillOption: function (option, mapName) {
// Shallow clone // Shallow clone
option = zrUtil.extend({}, option); option = zrUtil.extend({}, option);
var map = echarts.getMap(option.map); var map = echarts.getMap(mapName);
var geoJson = map && map.geoJson; var geoJson = map && map.geoJson;
geoJson && (option.data = fillData((option.data || []), geoJson)); geoJson && (option.data = fillData((option.data || []), geoJson));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册