@@ -65623,7 +65623,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
65623
65623
* @param echartsOptions - {Object} 图表参数
65624
65624
* @param options - {Object} 可选图层参数。<br>
65625
65625
* attribution - {string} 版权信息。<br>
65626
- * loadWhileAnimating - {boolean} 是否在移动时加载 。
65626
+ * loadWhileAnimating - {boolean} 是否在移动时实时绘制。默认为false 。
65627
65627
*/
65628
65628
var EchartsLayer = exports.EchartsLayer = _leaflet2["default"].Layer.extend({
65629
65629
@@ -65635,20 +65635,13 @@ var EchartsLayer = exports.EchartsLayer = _leaflet2["default"].Layer.extend({
65635
65635
65636
65636
options: {
65637
65637
attribution: "© 2017 百度 ECharts with <span>© <a href='http://iclient.supermap.io/' target='_blank'>SuperMap iClient</a></span>",
65638
- loadWhileAnimating: true
65638
+ loadWhileAnimating: false
65639
65639
},
65640
65640
65641
65641
initialize: function initialize(echartsOptions, options) {
65642
- if (echartsOptions) {
65643
- echartsOptions.LeafletMap = {
65644
- roam: true
65645
- };
65646
- echartsOptions.animation = false;
65647
- }
65648
- this._echartsOptions = echartsOptions;
65649
65642
_leaflet2["default"].Util.setOptions(this, options);
65643
+ this.setOption(echartsOptions);
65650
65644
},
65651
-
65652
65645
/**
65653
65646
* @function L.supermap.echartsLayer.prototype.setOption
65654
65647
* @description 设置图表地图参数
@@ -65657,15 +65650,17 @@ var EchartsLayer = exports.EchartsLayer = _leaflet2["default"].Layer.extend({
65657
65650
* @param lazyUpdate - {string} 后台自动更新
65658
65651
*/
65659
65652
setOption: function setOption(echartsOptions, notMerge, lazyUpdate) {
65660
- if ( echartsOptions) {
65661
- echartsOptions .LeafletMap = {
65662
- roam: true
65663
- };
65664
- }
65653
+ var baseOption = echartsOptions.baseOption || echartsOptions;
65654
+ baseOption.LeafletMap = baseOption .LeafletMap || {
65655
+ roam: true
65656
+ };
65657
+ baseOption.animation = baseOption.animation === true;
65665
65658
this._echartsOptions = echartsOptions;
65666
- this._ec.setOption(echartsOptions, notMerge, lazyUpdate);
65659
+ this._ec && this._ec.setOption(echartsOptions, notMerge, lazyUpdate);
65660
+ },
65661
+ getEcharts: function getEcharts() {
65662
+ return this._ec;
65667
65663
},
65668
-
65669
65664
_disableEchartsContainer: function _disableEchartsContainer() {
65670
65665
this._echartsContainer.style.visibility = "hidden";
65671
65666
},
@@ -65688,7 +65683,7 @@ var EchartsLayer = exports.EchartsLayer = _leaflet2["default"].Layer.extend({
65688
65683
map.on("zoomstart", function () {
65689
65684
me._disableEchartsContainer();
65690
65685
});
65691
- me.options.loadWhileAnimating && map.on("movestart", function () {
65686
+ ! me.options.loadWhileAnimating && map.on("movestart", function () {
65692
65687
me._disableEchartsContainer();
65693
65688
});
65694
65689
_echarts2["default"].registerAction({
@@ -65733,14 +65728,13 @@ var EchartsLayer = exports.EchartsLayer = _leaflet2["default"].Layer.extend({
65733
65728
var mapOffset = [offset.x || 0, offset.y || 0];
65734
65729
viewportRoot.style.left = mapOffset[0] + 'px';
65735
65730
viewportRoot.style.top = mapOffset[1] + 'px';
65736
-
65737
- if (me.options.loadWhileAnimating) {
65738
- for (var item in ecLayers) {
65739
- if (!ecLayers.hasOwnProperty(item)) {
65740
- continue;
65741
- }
65742
- ecLayers[item] && clearContext(ecLayers[item].ctx);
65731
+ for (var item in ecLayers) {
65732
+ if (!ecLayers.hasOwnProperty(item)) {
65733
+ continue;
65743
65734
}
65735
+ ecLayers[item] && clearContext(ecLayers[item].ctx);
65736
+ }
65737
+ if (!me.options.loadWhileAnimating) {
65744
65738
me._enableEchartsContainer();
65745
65739
}
65746
65740
@@ -65814,11 +65808,11 @@ var EchartsLayer = exports.EchartsLayer = _leaflet2["default"].Layer.extend({
65814
65808
* @class L.supermap.LeafletMapCoordSys
65815
65809
* @private
65816
65810
* @classdesc 地图坐标系统类
65817
- * @param LeafletMap - {L.map} 地图
65811
+ * @param leafletMap - {L.map} 地图
65818
65812
* @param api - {Object} 接口
65819
65813
*/
65820
- function LeafletMapCoordSys(LeafletMap ) {
65821
- this._LeafletMap = LeafletMap ;
65814
+ function LeafletMapCoordSys(leafletMap ) {
65815
+ this._LeafletMap = leafletMap ;
65822
65816
this.dimensions = ['lng', 'lat'];
65823
65817
this._mapOffset = [0, 0];
65824
65818
}
@@ -65906,20 +65900,23 @@ LeafletMapCoordSys.prototype.getRoamTransform = function () {
65906
65900
};
65907
65901
LeafletMapCoordSys.dimensions = LeafletMapCoordSys.prototype.dimensions;
65908
65902
65909
- LeafletMapCoordSys.create = function (ecModel, api ) {
65910
- var coordSys;
65903
+ LeafletMapCoordSys.create = function (ecModel) {
65904
+ var coordSys = void 0 ;
65911
65905
65912
- ecModel.eachComponent('LeafletMap', function (LeafletMapModel) {
65913
- var leafletMap = _echarts2["default"].leafletMap;
65906
+ ecModel.eachComponent('LeafletMap', function (leafletMapModel) {
65914
65907
if (!coordSys) {
65915
- coordSys = new LeafletMapCoordSys(leafletMap, api );
65908
+ coordSys = new LeafletMapCoordSys(_echarts2["default"]. leafletMap);
65916
65909
}
65917
- LeafletMapModel .coordinateSystem = coordSys || new LeafletMapCoordSys(_echarts2["default"].leafletMap) ;
65918
- LeafletMapModel .coordinateSystem.setMapOffset(LeafletMapModel .__mapOffset || [0, 0]);
65910
+ leafletMapModel .coordinateSystem = coordSys;
65911
+ leafletMapModel .coordinateSystem.setMapOffset(leafletMapModel .__mapOffset || [0, 0]);
65919
65912
});
65920
65913
ecModel.eachSeries(function (seriesModel) {
65921
- if (seriesModel.get('coordinateSystem') === 'leaflet') {
65922
- seriesModel.coordinateSystem = coordSys || new LeafletMapCoordSys(_echarts2["default"].leafletMap);
65914
+ if (!seriesModel.get('coordinateSystem') || seriesModel.get('coordinateSystem') === 'leaflet') {
65915
+ if (!coordSys) {
65916
+ coordSys = new LeafletMapCoordSys(_echarts2["default"].leafletMap);
65917
+ }
65918
+ seriesModel.coordinateSystem = coordSys;
65919
+ seriesModel.animation = seriesModel.animation === true;
65923
65920
}
65924
65921
});
65925
65922
};
@@ -68070,7 +68067,8 @@ var ImageMapLayer = exports.ImageMapLayer = _leaflet.Layer.extend({
68070
68067
68071
68068
if (this.options.position === 'front') {
68072
68069
this.bringToFront();
68073
- } else {
68070
+ }
68071
+ if (this.options.position === 'back') {
68074
68072
this.bringToBack();
68075
68073
}
68076
68074
0 commit comments