【问题标题】:Leaflet marker icon click event is not working传单标记图标单击事件不起作用
【发布时间】:2015-12-04 15:45:48
【问题描述】:

我通常在刷新页面时遇到传单标记的问题,标记是可点击的,但是当我来自另一个页面标记不可点击时,我尝试了所有方法,但没有找到任何解决方案。

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”)。

【问题讨论】:

    标签: javascript angularjs ionic-framework angular-leaflet-directive


    【解决方案1】:

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

    【讨论】:

    • 感谢您回来回答您自己的问题,而不是离开它。尊重++
    • 欢迎@CalebSwank
    猜你喜欢
    • 1970-01-01
    • 2014-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-26
    • 2021-02-12
    • 2015-08-11
    相关资源
    最近更新 更多