忽略尝试取消touchstart事件,并在单击和拖动事件时使用cancelable = false警告

时间:2016-09-29 14:09:34

标签: ionic-framework leaflet angular-leaflet-directive ui-leaflet

Ignored attempt to cancel a touchstart event with cancelable=false,
for example because scrolling is in progress and cannot be interrupted.

尝试单击或拖动地图时,我不断收到此错误消息。 然而,双击工作正常。

有时它会让我拖动地图,然后在几秒钟后得到消息。 它开始出现后我无法摆脱它。

我使用这个ui-leaflet@1.0.2和传单0.7.7,我也尝试过传单1.0.0。

我的应用中有两张地图,分别位于不同的控制器和不同的页面上。 (使用离子)

这可能与它有关吗?

        $scope.$on('leafletDirectiveMap.click', function(event, args){
            $log.log('click');
            $log.log(event);
            $log.log(args);
        });

我使用它来捕捉点击事件,但它似乎也没有工作,它使我在点击而不是回应事件时出现上述信息。

我仍然可以点击标记并弹出它们的弹出窗口,我可以双击缩放。 只是似乎拖动并单击不想正常工作。

如果删除第二张地图,我在第一张地图上仍然会收到同样的错误。

我的地图设置

    $scope.map = {
        defaults: {
            zoomControl: false,
            tileLayer: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
            scrollWheelZoom: false,
            detectRetina: true,
            reuseTiles: true
        },
        center: {
            lat: -33.9337,
            lng: 151.1807,
            zoom: 14
        },
        events: {
            map: {
                enable: ['click'],
                logic: 'broadcast'
            }
        },
        markers: markers
    };

并在html中

<leaflet lf-center="map.center" defaults="map.defaults" height="calc(100% - 66px)" width="100%" markers="map.markers" id="map"></leaflet>

0 个答案:

没有答案
相关问题