Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 01960a1

Browse files
【fix】升级canvg
1 parent f82006b commit 01960a1

File tree

13 files changed

+7
-23
lines changed

13 files changed

+7
-23
lines changed

‎build/webpack.config.classic.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ module.exports = {
2020
resolve: configBase.resolve,
2121
externals: Object.assign({}, configBase.externals, {
2222
'xlsx': "function(){try{return XLSX}catch(e){return {}}}()",
23-
'canvg': "function(){try{return canvg}catch(e){return {}}}()",
2423
'jsonsql': "function(){try{return jsonsql}catch(e){return {}}}()",
2524
'xml-js': "function(){try{return convert}catch(e){return {}}}()"
2625
}),

‎build/webpack.config.mapboxgl.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module.exports = {
3232
'luma.gl': '(function(){try{return luma}catch(e){return {}}})()',
3333
'webgl-debug': '(function(){try{return webgl-debug}catch(e){return {}}})()',
3434
xlsx: 'function(){try{return XLSX}catch(e){return {}}}()',
35-
canvg: 'function(){try{return canvg}catch(e){return {}}}()',
3635
'@turf/turf': 'function(){try{return turf}catch(e){return {}}}()',
3736
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()',
3837
'./L7/l7-render': 'function(){try{return L7}catch(e){return {}}}()',

‎build/webpack.config.maplibregl.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ module.exports = {
3131
'webgl-debug': '(function(){try{return webgl-debug}catch(e){return {}}})()',
3232
'luma.gl': '(function(){try{return luma}catch(e){return {}}})()',
3333
xlsx: 'function(){try{return XLSX}catch(e){return {}}}()',
34-
canvg: 'function(){try{return canvg}catch(e){return {}}}()',
3534
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()',
3635
'xml-js': 'function(){try{return convert}catch(e){return {}}}()',
3736
'./L7/l7-render': 'function(){try{return L7}catch(e){return {}}}()',

‎build/webpack.config.openlayers.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ var externals = [
2323
'luma.gl': '(function(){try{return luma}catch(e){return {}}})()',
2424
'webgl-debug': '(function(){try{return webgl-debug}catch(e){return {}}})()',
2525
xlsx: 'function(){try{return XLSX}catch(e){return {}}}()',
26-
canvg: 'function(){try{return canvg}catch(e){return {}}}()',
2726
jsonsql: 'function(){try{return jsonsql}catch(e){return {}}}()',
2827
three: 'function(){try{return THREE}catch(e){return {}}}()'
2928
}),

‎dist/mapboxgl/include-mapboxgl.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@
131131
if (inArray(includes, 'geostats')) {
132132
inputScript(libsurl + '/geostats/geostats.js');
133133
}
134-
if (inArray(includes, 'canvg')) {
135-
inputScript(libsurl + '/canvg/3.0.10/umd.min.js');
136-
}
137134
if (inArray(includes, 'XMLParser')) {
138135
inputScript(libsurl + '/fast-xml-parser/4.2.7/fxparser.min.js');
139136
}

‎dist/maplibregl/include-maplibregl.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@
128128
if (inArray(includes, 'geostats')) {
129129
inputScript(libsurl + '/geostats/geostats.js');
130130
}
131-
if (inArray(includes, 'canvg')) {
132-
inputScript(libsurl + '/canvg/3.0.10/umd.min.js');
133-
}
134131
if (inArray(includes, 'LegacyJSONLoader')) {
135132
inputScript(libsurl + '/three/0.110.0/examples/js/loaders/deprecated/LegacyJSONLoader.js');
136133
}

‎dist/ol/include-ol.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@
114114
if (inArray(includes, 'geostats')) {
115115
inputScript(libsurl + '/geostats/geostats.js');
116116
}
117-
if (inArray(includes, 'canvg')) {
118-
inputScript(libsurl + '/canvg/3.0.10/umd.min.js');
119-
}
120117
if (inArray(includes, 'tensorflow')) {
121118
inputScript(libsurl + '/tensorflow/3.9.0/tf.min.js');
122119
}

‎dist/openlayers/include-openlayers.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@
114114
if (inArray(includes, 'geostats')) {
115115
inputScript(libsurl + '/geostats/geostats.js');
116116
}
117-
if (inArray(includes, 'canvg')) {
118-
inputScript(libsurl + '/canvg/3.0.10/umd.min.js');
119-
}
120117
if (inArray(includes, 'tensorflow')) {
121118
inputScript(libsurl + '/tensorflow/3.9.0/tf.min.js');
122119
}

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"@turf/center": "^6.5.0",
146146
"@turf/meta": "^6.5.0",
147147
"@turf/turf": "6.5.0",
148-
"canvg": "3.0.10",
148+
"canvg": "^4.0.3",
149149
"echarts": "5.5.0",
150150
"fast-xml-parser": "^4.2.7",
151151
"fetch-ie8": "1.5.0",

‎src/common/mapping/WebMapV2Base.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Canvg from 'canvg';
1+
import {Canvg} from 'canvg';
22
import { coordEach } from '@turf/meta';
33
import difference from 'lodash.difference';
44
import { WebMapService } from './WebMapService';
@@ -548,7 +548,7 @@ export function createWebMapV2BaseExtending(SuperClass = Events, fireField = 'tr
548548
canvas.style.display = 'none';
549549
divDom.appendChild(canvas);
550550
if (svgUrl) {
551-
const canvgs = (window.canvg||{}).default ? window.canvg.default : Canvg;
551+
const canvgs = Canvg;
552552
const ctx = canvas.getContext('2d');
553553
canvgs.from(ctx, svgUrl, {
554554
ignoreMouse: true,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /