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

Function makeImage

libs/echarts/echarts-en.simple.js:16968–16988  ·  view source on GitHub ↗

* Create a image element from image url * @param {string} imageUrl image url * @param {Object} opts options * @param {module:zrender/core/BoundingRect} rect constrain rect * @param {string} [layout=cover] 'center' or 'cover'

(imageUrl, rect, layout)

Source from the content-addressed store, hash-verified

16966 * @param {string} [layout=cover] 'center' or 'cover'
16967 */
16968function makeImage(imageUrl, rect, layout) {
16969 var path = new ZImage({
16970 style: {
16971 image: imageUrl,
16972 x: rect.x,
16973 y: rect.y,
16974 width: rect.width,
16975 height: rect.height
16976 },
16977 onload: function (img) {
16978 if (layout === 'center') {
16979 var boundingRect = {
16980 width: img.width,
16981 height: img.height
16982 };
16983 path.setStyle(centerGraphic(rect, boundingRect));
16984 }
16985 }
16986 });
16987 return path;
16988}
16989
16990/**
16991 * Get position of centered element in bounding box.

Callers 1

createSymbolFunction · 0.70

Calls 2

centerGraphicFunction · 0.70
setStyleMethod · 0.45

Tested by

no test coverage detected