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

Function createIcon

libs/echarts/echarts.simple.js:18138–18159  ·  view source on GitHub ↗

* @param {string} iconStr Support 'image://' or 'path://' or direct svg path. * @param {Object} [opt] Properties of `module:zrender/Element`, except `style`. * @param {Object} [rect] {x, y, width, height} * @return {module:zrender/Element} Icon path or image element.

(iconStr, opt, rect)

Source from the content-addressed store, hash-verified

18136 * @return {module:zrender/Element} Icon path or image element.
18137 */
18138function createIcon(iconStr, opt, rect) {
18139 opt = extend({rectHover: true}, opt);
18140 var style = opt.style = {strokeNoScale: true};
18141 rect = rect || {x: -1, y: -1, width: 2, height: 2};
18142
18143 if (iconStr) {
18144 return iconStr.indexOf('image://') === 0
18145 ? (
18146 style.image = iconStr.slice(8),
18147 defaults(style, rect),
18148 new ZImage(opt)
18149 )
18150 : (
18151 makePath(
18152 iconStr.replace('path://', ''),
18153 opt,
18154 rect,
18155 'center'
18156 )
18157 );
18158 }
18159}
18160
18161/**
18162 * Return `true` if the given line (line `a`) and the given polygon

Callers

nothing calls this directly

Calls 4

indexOfMethod · 0.80
extendFunction · 0.70
defaultsFunction · 0.70
makePathFunction · 0.70

Tested by

no test coverage detected