forked from MapGIS/WebClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage.js
More file actions
106 lines (91 loc) · 3.6 KB
/
Image.js
File metadata and controls
106 lines (91 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import {Zondy} from '../../../service/common/Base';
import {ShapeParameters} from './ShapeParameters';
/**
* @private
* @class Zondy.Feature.ShapeParameters.Image
* @classdesc 图片参数对象。
* @extends {Zondy.Feature.ShapeParameters}
*/
class Image extends ShapeParameters {
/**
* @function Zondy.Feature.ShapeParameters.Image.prototype.constructor
* @description 创建一个图片参数对象。
* @param {number} x - 左上角横坐标,必设参数。
* @param {number} y - 左上角纵坐标,必设参数。
* @param {(string|Object)} image - 图片地址或Cavans对象,必设参数。
* @param {number} width - 绘制到画布上的宽度,默认为图片高度。
* @param {number} height - 绘制到画布上的高度,默认为图片高度。
* @param {number} sx - 从图片中裁剪的左上角横坐标。
* @param {number} sy - 从图片中裁剪的左上角纵坐标。
* @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
* @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
* @returns {Zondy.Feature.ShapeParameters.Image} 圆形参数对象。
*/
constructor(x, y, image, width, height, sx, sy, sWidth, sHeight) {
super(x, y, image, width, height, sx, sy, sWidth, sHeight);
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.x
* @description 左上角横坐标,必设参数。
*/
this.x = x;
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.y
* @description 左上角纵坐标,必设参数。
*/
this.y = y;
/**
* @member {(string|Object)} Zondy.Feature.ShapeParameters.Image.prototype.image
* @description 图片地址。
*/
this.image = image;
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.width
* @description 绘制到画布上的宽度,默认为图片高度。
*/
this.width = width;
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.height
* @description 绘制到画布上的高度,默认为图片高度。
*/
this.height = height;
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.sx
* @description 从图片中裁剪的左上角横坐标。
*/
this.sx = sx;
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.sy
* @description 从图片中裁剪的左上角纵坐标。
*/
this.sy = sy;
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.sWidth
* @description 从图片中裁剪的宽度,默认为图片高度。
*/
this.sWidth = sWidth;
/**
* @member {number} Zondy.Feature.ShapeParameters.Image.prototype.sHeight
* @description 绘制到画布上的高度,默认为图片高度。
*/
this.sHeight = sHeight;
this.CLASS_NAME = "Zondy.Feature.ShapeParameters.Image";
}
/**
* @function Zondy.Feature.ShapeParameters.Image.prototype.destroy
* @description 销毁对象。
*/
destroy() {
this.x = null;
this.y = null;
this.image = null;
this.width = null;
this.height = null;
this.sx = null;
this.sy = null;
this.sWidth = null;
this.sHeight = null;
super.destroy();
}
}
export {Image};
Zondy.Feature.ShapeParameters.Image = Image;