gis-common 5.1.32 → 5.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/17.png +0 -0
- package/dist/gis-common.es.js +10 -8
- package/dist/gis-common.umd.js +1 -1
- package/dist/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/17.png
CHANGED
|
Binary file
|
package/dist/gis-common.es.js
CHANGED
|
@@ -3387,10 +3387,10 @@ class CanvasDrawer {
|
|
|
3387
3387
|
* @param options 绘制选项,包括线条宽度和颜色
|
|
3388
3388
|
* @throws 当画布上下文不存在时抛出错误
|
|
3389
3389
|
*/
|
|
3390
|
-
drawLine({ x: startX, y: startY }, { x: endX, y: endY }, options
|
|
3390
|
+
drawLine({ x: startX, y: startY }, { x: endX, y: endY }, options) {
|
|
3391
3391
|
this.ctx.beginPath();
|
|
3392
|
-
const width = options.width || 1;
|
|
3393
|
-
const color = options.color || "#000";
|
|
3392
|
+
const width = (options == null ? void 0 : options.width) || 1;
|
|
3393
|
+
const color = (options == null ? void 0 : options.color) || "#000";
|
|
3394
3394
|
this.ctx.lineWidth = width;
|
|
3395
3395
|
this.ctx.strokeStyle = color;
|
|
3396
3396
|
this.ctx.moveTo(startX, startY);
|
|
@@ -3423,12 +3423,14 @@ class CanvasDrawer {
|
|
|
3423
3423
|
this.ctx.stroke();
|
|
3424
3424
|
}
|
|
3425
3425
|
}
|
|
3426
|
-
drawImage({ x, y }, image,
|
|
3427
|
-
const width = image.width;
|
|
3428
|
-
const height = image.height;
|
|
3426
|
+
drawImage({ x, y }, image, options = {}) {
|
|
3427
|
+
const width = options.width || image.width;
|
|
3428
|
+
const height = options.height || image.height;
|
|
3429
|
+
const angle = options.angle || 0;
|
|
3430
|
+
this.ctx.save();
|
|
3429
3431
|
this.ctx.translate(x, y);
|
|
3430
|
-
if (
|
|
3431
|
-
const angleRad =
|
|
3432
|
+
if (angle) {
|
|
3433
|
+
const angleRad = angle * Math.PI / 180;
|
|
3432
3434
|
this.ctx.rotate(angleRad);
|
|
3433
3435
|
}
|
|
3434
3436
|
this.ctx.drawImage(image, -width / 2, -height / 2, width, height);
|