RotateEvent
缩放事件,一般用于视窗交互中缩放视图。
- 移动端: 双指旋转
- 触摸板: 双指旋转(仅 Safari 支持)
示例
App.vue
Import Map
xxxxxxxxxx
27
<script setup lang="ts">
import type { IRotateEvent } from '@leafer-ui/interface'
import { LeaferApp } from 'leafer-vue'
import { ref } from 'vue'
const rotation = ref(0)
function handeleRotate(e: IRotateEvent) {
rotation.value = e.rotation
}
</script>
<template>
<LeaferApp :width="672" :height="340" type="draw">
<Leafer @zoom="handeleRotate">
<Rect
:width="100"
:height="100"
:x="250"
:y="100"
:rotation="rotation"
fill="#66A659"
draggable
/>
</Leafer>
</LeaferApp>
</template>
Show Error
事件名称
事件名 | 说明 | 参数 |
---|---|---|
rotateStart | 开始旋转事件 | IRotateEvent |
rotate | 旋转事件 | IRotateEvent |
rotateEnd | 结束旋转事件 | IRotateEvent |