Skip to content

Commit

Permalink
fix webmap 导出
Browse files Browse the repository at this point in the history
  • Loading branch information
xilanhuaweidapao committed Feb 29, 2024
1 parent cc2ceae commit dd5a320
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/mapboxgl/mapping/WebMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,4 @@
return this.webMapInstance;
}
}

mapboxgl.supermap.WebMap = WebMap;

1 change: 1 addition & 0 deletions src/mapboxgl/mapping/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { WebMap } from './WebMap';
export { initMap } from './InitMap';
export { WebMap as WebMapV3} from './webmap/v3/WebMap';
8 changes: 4 additions & 4 deletions src/mapboxgl/mapping/webmap/v2/WebMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
ColorsPickerUtil
} from '@supermap/iclient-common';
import { Util } from '../../../core/Util';
import convert from 'xml-js';
import canvg from 'canvg';
import { XMLParser } from "fast-xml-parser";

const MB_SCALEDENOMINATOR_3857 = [
'559082264.0287178',
Expand Down Expand Up @@ -324,9 +324,9 @@ const DEFAULT_WELLKNOWNSCALESET = ['GoogleCRS84Quad', 'GoogleMapsCompatible'];
return response.text();
})
.then(capabilitiesText => {
let converts = convert ? convert : window.convert;
let tileMatrixSet = JSON.parse(converts.xml2json(capabilitiesText, { compact: true, spaces: 4 }))
.Capabilities.Contents.TileMatrixSet;
const parser = new XMLParser({numberParseOptions:{hex : false, leadingZeros: false,eNotation: false},alwaysCreateTextNode: true, textNodeName: "_text"});
let tileMatrixSet = parser.parse(capabilitiesText)
.Capabilities.Contents.TileMatrixSet;
if (!Array.isArray(tileMatrixSet)) {
tileMatrixSet = [tileMatrixSet];
}
Expand Down
2 changes: 0 additions & 2 deletions src/mapboxgl/mapping/webmap/v3/WebMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,3 @@ export class WebMap extends mapboxgl.Evented {
return layers;
}
}

mapboxgl.supermap.WebMapV3 = WebMap;
3 changes: 2 additions & 1 deletion src/mapboxgl/namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import {
ChartView
} from '@supermap/iclient-common/namespace';

import { WebMap, initMap } from './mapping';
import { WebMap, initMap, WebMapV3 } from './mapping';
import mapboxgl from 'mapbox-gl';

mapboxgl.supermap = {...SuperMap, ...mapboxgl.supermap};
Expand All @@ -75,6 +75,7 @@ mapboxgl.supermap.Logo = Logo;
mapboxgl.supermap.Util = Util;
mapboxgl.supermap.WebMap = WebMap;
mapboxgl.supermap.initMap = initMap;
mapboxgl.supermap.WebMapV3 = WebMapV3;
mapboxgl.supermap.Graphic = Graphic;
mapboxgl.supermap.map.getDefaultVectorTileStyle = getDefaultVectorTileStyle;
mapboxgl.supermap.map.setBackground = setBackground;
Expand Down

0 comments on commit dd5a320

Please sign in to comment.