MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / getTextOffset

Method getTextOffset

src/openlayers/core/StyleUtils.js:728–734  ·  view source on GitHub ↗

* @function StyleUtils.getTextOffset * @description 获取字体图标的偏移值 * @param {string} fontSize - 字体大小,如12px * @param {number} offsetX - X方向偏移分数 * @param {number} offsetY - Y方向偏移分数 * @returns {Object}

(fontSize, offsetX=0, offsetY=0)

Source from the content-addressed store, hash-verified

726 * @returns {Object}
727 */
728 static getTextOffset(fontSize, offsetX=0, offsetY=0) {
729 const radius = fontSize.substr(0, fontSize.length - 2) / 2;
730 return {
731 x: radius*offsetX,
732 y: radius*offsetY
733 };
734 }
735
736 /**
737 * 获取文字标注对应的canvas

Callers 1

getSymbolStyleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected