File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff 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 ( ) {
Original file line number Diff line number Diff line change @@ -13,10 +13,18 @@ import {getAction} from "../Util/request";
1313import axios from "axios" ;
1414
1515export 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 ;
You can’t perform that action at this time.
0 commit comments