Skip to content

Commit 5c0ed15

Browse files
2 parents 98d8fe3 + e87e37f commit 5c0ed15

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,14 +4104,14 @@ export class WebMap extends Observable {
41044104
*/
41054105
createMigrationLayer(layerInfo, features) {
41064106
// 获取图层外包DOM
4107-
if (!window.EChartsLayer.prototype.getContainer) {
4108-
window.EChartsLayer.prototype.getContainer = function () {
4107+
if (!window.ol3Echarts.prototype.getContainer) {
4108+
window.ol3Echarts.prototype.getContainer = function () {
41094109
return this.$container;
41104110
};
41114111
}
41124112
// 设置图层可见性
4113-
if (!window.EChartsLayer.prototype.setVisible) {
4114-
window.EChartsLayer.prototype.setVisible = function (visible) {
4113+
if (!window.ol3Echarts.prototype.setVisible) {
4114+
window.ol3Echarts.prototype.setVisible = function (visible) {
41154115
if (visible) {
41164116
let options = this.get('options');
41174117
if (options) {
@@ -4127,8 +4127,8 @@ export class WebMap extends Observable {
41274127
};
41284128
}
41294129
// 设置图层层级
4130-
if (!window.EChartsLayer.prototype.setZIndex) {
4131-
window.EChartsLayer.prototype.setZIndex = function (zIndex) {
4130+
if (!window.ol3Echarts.prototype.setZIndex) {
4131+
window.ol3Echarts.prototype.setZIndex = function (zIndex) {
41324132
let container = this.getContainer();
41334133
if (container) {
41344134
container.style.zIndex = zIndex;
@@ -4141,8 +4141,8 @@ export class WebMap extends Observable {
41414141
* cursor: default !important;
41424142
* }
41434143
*/
4144-
if (!window.EChartsLayer.prototype.setCursor) {
4145-
window.EChartsLayer.prototype.setCursor = function (cursor = 'default') {
4144+
if (!window.ol3Echarts.prototype.setCursor) {
4145+
window.ol3Echarts.prototype.setCursor = function (cursor = 'default') {
41464146
let container = this.getContainer();
41474147
if (container && cursor === 'default') {
41484148
container.classList.add('cursor-default');
@@ -4153,7 +4153,7 @@ export class WebMap extends Observable {
41534153
let lineData = this.createLinesData(layerInfo, properties);
41544154
let pointData = this.createPointsData(lineData, layerInfo, properties);
41554155
let options = this.createOptions(layerInfo, lineData, pointData);
4156-
let layer = new window.EChartsLayer(options, {
4156+
let layer = new window.ol3Echarts(options, {
41574157
// hideOnMoving: true,
41584158
// hideOnZooming: true
41594159
//以下三个参数,如果不按照这样设置,会造成不可见图层时,缩放还会出现图层

src/openlayers/overlay/vectortile/MapboxStyles.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ export class MapboxStyles extends Observable {
288288
this._initStyleFunction();
289289
};
290290
img.src = this._spriteImageUrl;
291+
})
292+
.catch( err => {
293+
console.log(err);
294+
this._spriteImage = null;
295+
this._initStyleFunction();
291296
});
292297
} else {
293298
this._initStyleFunction();

0 commit comments

Comments
 (0)