繁体   English   中英

单张标记图标点击事件不起作用

[英]Leaflet marker icon click event is not working

当我刷新页面时,我通常会遇到小叶标记的问题,该标记是可单击的,但是当我来自另一个页面标记却不可单击时,我尝试了所有操作,但未找到任何解决方案。

JAVASCRIPT:

angular.extend($scope, {
center: {
    lat: 51.505,
    lng: -0.09,
    zoom: 8
},
markers: {},

});

mapService.getLocation(function(location) {
    $scope.center = {
        lat: location.lat,
        lng: location.long,
        zoom: 12
    };
    $scope.$digest($scope.center);
    mapService.getMarkers(
        new google.maps.LatLng(location.lat, location.long),
        document.getElementById('map'), ['school'],
        function(results) {
            results.forEach(function(marker) {
                var __location = marker.geometry.location.toJSON();
                $scope.markers[marker.id] = {
                    lat: __location.lat,
                    lng: __location.lng,
                    message: marker.name,
                    focus: false
                }
            });
            $scope.$digest($scope.markers);
        }
    )
});

HTML:

<leaflet
width="100%"
markers="markers"
lf-center="center">

[注意]我正在使用传单(版本:“ 0.7.7”)和角叶指令(版本:“ 0.10.0”)。

我的问题仅通过添加传单地图的data-tap-disabled="true"父标签即可解决

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM