Mapbox的Andr​​oid禁用滚动和平移地图地图、Mapbox、Andr、oid

2023-09-06 07:59:41 作者:凉城听暖

我试图禁用缩放和平移的MapView在mapbox。我用mapbox 0.4.0。目前,我可以禁用变焦,但不能禁用泛

  MapView的MV =(图形页面)tab.findViewById(R.id.mapid);    mv.setZoom(14);    mv.setMaxZoomLevel(14);    mv.setMinZoomLevel(14); 

解决方案

不幸的是,唯一的解决办法是把一个透明的看法上会消耗触摸地图上。我用的是按钮透明背景。此时MapBox的还是已经不允许开发者禁用用户交互。

I'm trying to disable the zoom and pan the mapview in a mapbox. I use mapbox 0.4.0. Currently I can disable the zoom, but cannot disable the pan

    MapView mv = (MapView) tab.findViewById(R.id.mapid);
    mv.setZoom(14);
    mv.setMaxZoomLevel(14);
    mv.setMinZoomLevel(14);

解决方案

Unfortunately, the only solution is to put a transparent view on top of the map that will consume the touches. I use a Button with a transparent background. At this point MapBox still hasn't allowed devs to disable user interaction.