Skip to content

Commit 3b4309f

Browse files
committed
【SDK】【指定行业标绘基本路径】
1 parent fb317da commit 3b4309f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/service/PlotBase/SymbolManager/SymbolManager.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ export default class SymbolManager {
1919
this._symbols = null;
2020
this._symbolsUrl = "";
2121

22-
const {fontURL = ''} = options;
23-
if(fontURL) {
22+
const {fontURL = '', baseUrl = ''} = options;
23+
24+
if(!window._mapgisSymanagerConfig_) {
2425
window._mapgisSymanagerConfig_ = {};
26+
}
27+
28+
if(fontURL) {
2529
window._mapgisSymanagerConfig_._fontURL = fontURL;
2630
}
2731

32+
if(baseUrl) {
33+
window._mapgisSymanagerConfig_._baseUrl = baseUrl;
34+
}
35+
2836
if (!SymbolManager.instance) {
2937
this._symbolsUrl = symbolsUrl;
3038
SymbolManager.instance = this;

src/service/PlotBase/SymbolManager/SymbolNode.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ export default class SymbolNode extends SymbolBase {
8989
* 获取符号对应svg
9090
*/
9191
async getSvg() {
92-
const url = this.src;
92+
let url = this.src;
93+
if(window._mapgisSymanagerConfig_ && window._mapgisSymanagerConfig_._baseUrl) {
94+
url = window._mapgisSymanagerConfig_._baseUrl + url;
95+
}
9396
const res = await axios({
9497
method: 'get',
9598
url: url,

0 commit comments

Comments
 (0)