# MapTouchEvent
扩展对象
MapTouchEvent是其他类用来生成特定类型的鼠标事件的类,例如“touchstart”或“touchend”。有关可用事件的完整列表,请参阅``Mapevents。
# Parameters
typestringmap地图originalEvent触摸事件
# Examples
// Example of a MapTouchEvent of type "touch"
{
lngLat: {
lng: 40.203,
lat: -74.451
},
lngLats: [
{
lng: 40.203,
lat: -74.451
}
],
originalEvent: {...},
point: {
x: 266,
y: 464
},
points: [
{
x: 266,
y: 464
}
]
preventDefault(),
target: {...},
type: "touchstart"
}
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
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
# type
始发事件的类型。有关可用事件的完整列表,请参阅``Mapevents。
类型:( "touchstart"| "touchend"| "touchcancel")
# target
Map触发事件的对象。
类型:地图
# originalEvent
引发地图事件的 DOM 事件。
类型:触摸事件
# LngLat
地图上触摸事件点中心的地理位置。
类型:[LngLat][230]
# point
触摸事件点中心的像素坐标,相对于地图,从左上角开始测量。
类型:点
# points
对应于触摸事件的像素坐标数组 touches 财产。
类型:Array<点>
# lngLats
地图上对应于触摸事件的地理位置 touches 财产。
类型:Array< [LngLat][230] >
# preventDefault
阻止地图对事件的后续默认处理。
调用此方法将阻止以下默认地图行为:
- 在
touchstart事件上,DragPanHandler][191]的行为[ - 在
touchstart事件上,TouchZoomRotateHandler][193]的行为[