Daa*_*cal 1 javascript mapbox typescript mapbox-gl-js
我正在尝试禁用地图的所有移动,除了旋转和缩放到设定点之外。但在触摸设备上,我仍然可以用两根手指将“相机”从设定点移动,它在非触摸设备上工作得很好。
这是我目前所拥有的,但并不能完全工作,我仍然可以用触摸设备上的两根手指移动相机中心点。我正在使用带有离子/角度的打字稿。
this.map = new mapboxgl.Map({
container: 'game_map',
style: 'mapbox://styles/mapbox/light-v10',
center: [coords],
zoom: 20,
touchZoomRotate: {around: 'center'},
scrollZoom: {around: 'center'},
pitch: 60,
bearing: -60,
antialias: true,
attributionControl: false,
maxZoom: 22,
minZoom: 17
});
Run Code Online (Sandbox Code Playgroud)