Skip to content

Commit fc3bf02

Browse files
[fix]ol 10.5.0
1 parent d01eb6e commit fc3bf02

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

dist/ol/include-ol.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
var excludes = (targetScript.getAttribute('exclude') || '').split(',');
5757
// 在线
5858
if (!inArray(includes, 'ol-debug') && !inArray(includes, '[email protected]') && !inArray(excludes, 'ol')) {
59-
inputCSS(libsurl + '/openlayers/7.5.2/ol.min.css');
60-
inputScript(libsurl + '/openlayers/7.5.2/ol.js');
59+
inputCSS(libsurl + '/openlayers/10.5.0/ol.min.css');
60+
inputScript(libsurl + '/openlayers//10.5.0/ol.js');
6161
}
6262
if (inArray(includes, '[email protected]')) {
6363
inputCSS(libsurl + '/openlayers/4.6.5/ol.css');
@@ -83,7 +83,7 @@
8383
inputScript(libsurl + '/proj4/2.17.0/proj4.min.js');
8484
}
8585
if (inArray(includes, 'ol3-echarts')) {
86-
inputScript(libsurl + '/openlayers/ol3-echarts/4.0.1-1/ol-echarts.js');
86+
inputScript(libsurl + '/openlayers/ol3-echarts/4.0.2/ol-echarts.min.js');
8787
}
8888
if (inArray(includes, '[email protected]')) {
8989
inputScript(libsurl + '/openlayers/ol3-echarts/1.3.6/ol3Echarts.min.js');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
"maplibre-gl": "5.6.0",
168168
"mapv": "2.0.62",
169169
"node-forge": "^1.3.1",
170-
"ol": "7.5.2",
170+
"ol": "10.5.0",
171171
"pbf": "3.2.1",
172172
"proj4": "2.17.0",
173173
"promise-polyfill": "8.2.3",

src/openlayers/control/ScaleLine.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import Scale from 'ol/control/ScaleLine';
66
import * as olProj from 'ol/proj';
7-
import AssertionError from 'ol/AssertionError';
87

98
/**
109
* @class ScaleLine
@@ -119,7 +118,7 @@ export class ScaleLine extends Scale {
119118
pointResolution /= 1609.3472;
120119
}
121120
} else {
122-
throw new AssertionError(33); // Invalid units
121+
throw new Error('Invalid units');// Invalid units
123122
}
124123
var DIGITS = [1, 2, 5];
125124
let i = 3 * Math.floor(

src/openlayers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@supermapgis/tile-decryptor": "^1.0.0",
2020
"@turf/turf": "7.2.0",
2121
"mapv": "2.0.62",
22-
"ol": "7.5.2",
22+
"ol": "10.5.0",
2323
"canvg": "^4.0.3",
2424
"lodash.clonedeep": "^4.5.0",
2525
"lodash.remove": "^4.7.0",

test/openlayers/control/ScaleLineSpec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,20 @@ describe('openlayers_ScaleLine', () => {
8888
expect(scaleControl.element.style.display).toBe('none');
8989
done();
9090
});
91+
92+
it('test updateElementRepair error', (done) => {
93+
var scaleControl = new ScaleLine();
94+
map.addControl(scaleControl);
95+
map.once('postrender', () => {
96+
setTimeout(() => {
97+
try {
98+
scaleControl.setUnits('error');
99+
scaleControl.updateElementRepair();
100+
} catch (error) {
101+
expect(error.message).toBe('Invalid units');
102+
done();
103+
}
104+
}, 100);
105+
});
106+
});
91107
});

0 commit comments

Comments
 (0)