Skip to content

Commit 71e14db

Browse files
author
zhaokai
committed
Merge branch 'webclient_plot' of github.com:MapGIS/WebClient-JavaScript into webclient_plot
2 parents 9d8dd16 + 35ee61d commit 71e14db

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/service/PlotBase/SvgLoader/element/FontCache.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ class FontCache {
3030

3131
_getFont(strFontName) {
3232
let font = null;
33-
const strPath = "assets/fonts/" + strFontName + ".json";
33+
let strPath = "assets/fonts/" + strFontName + ".json";
34+
if(window._mapgisSymanagerConfig_ && window._mapgisSymanagerConfig_._fontURL) {
35+
strPath = window._mapgisSymanagerConfig_._fontURL + strPath;
36+
}
3437

3538
const request = new XMLHttpRequest();
3639
request.onreadystatechange = function () {

src/service/PlotBase/SymbolManager/SymbolManager.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ import {getAction} from "../Util/request";
1313
import axios from "axios";
1414

1515
export default class SymbolManager {
16-
constructor(symbolsUrl) {
16+
constructor(symbolsUrl, options) {
17+
options = options || {};
18+
1719
this._symbols = null;
1820
this._symbolsUrl = "";
1921

22+
const {fontURL = ''} = options;
23+
if(fontURL) {
24+
window._mapgisSymanagerConfig_ = {};
25+
window._mapgisSymanagerConfig_._fontURL = fontURL;
26+
}
27+
2028
if (!SymbolManager.instance) {
2129
this._symbolsUrl = symbolsUrl;
2230
SymbolManager.instance = this;

0 commit comments

Comments
 (0)