MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / _getLabelFontFamily

Method _getLabelFontFamily

src/common/mapping/WebMapV3.js:728–739  ·  view source on GitHub ↗

* @private * @function WebMapV3.prototype._getLabelFontFamily * @description 获取图层字体类型。

()

Source from the content-addressed store, hash-verified

726 * @description 获取图层字体类型。
727 */
728 _getLabelFontFamily() {
729 const fonts = ['sans-serif'];
730 const layers = this._mapInfo.layers;
731 if (layers && layers.length > 0) {
732 layers.forEach((layer) => {
733 const textFont = (layer.layout && layer.layout['text-font']) || [];
734 fonts.push(...textFont);
735 });
736 }
737 const fontFamilys = fonts.join(',');
738 return fontFamilys;
739 }
740
741 /**
742 * @private

Callers 1

_createMapMethod · 0.95

Calls 2

forEachMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected