在iOS设备上未触发angular leaflet指令自定义弹出单击事件

时间:2016-12-02 09:08:07

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

我正在使用角度传单指令和离子在iOS设备上开发地图,我需要弹出式点击,它可以在网络浏览器上正常工作,但在iOS模拟器上却无法正常工作。

var html11 =
            '<div style="width:660px;" ng-click="goToDetail(clickedMarkerInfo)">'
            + '<div class="tripguide-tootip-row-left" ng-click="goToDetail(clickedMarkerInfo)">'
            + '<div class="tripguide-tootip-image">'
            + '<img ng-src={{clickedMarkerInfo.picture}}>'
            + '</div>'
            + '<div class="tripguide-tootip-rating" ng-show="whetherToShow(clickedMarkerInfo.rating)">'
            + '<img ng-repeat="pic in clickedMarkerInfo.ratingPics track by $index"src="{{pic}}" />'
            + '</div>'
            + '</div>'
            + '<div class="tripguide-tootip-row-right" ng-click="goToDetail(clickedMarkerInfo)">'
            + '<div class="tripguide-tootip-legend">'
            + '<span>{{clickedMarkerInfo.name}}</span>'
            + '</div>'
            + '<div class="tripguide-tootip-address">'
            + '<span>{{clickedMarkerInfo.address}}</span>'
            + '</div>'
            + '</div>'
            + '<div class="tripguide-tooltip-arrow">'
            + '<img src="images/tripguide/tooltip-arrow.png">'
            + '</div>'
            + '</div>';
 var marker = {
                lat: myLatlng[0],
                lng: myLatlng[1],
                getMessageScope: function () {
                    return $scope;
                },
                message: html11,
                compileMessage: true
            };

 $scope.markersArray.push(marker);

iOS版本为9.3。也许那是一个离子和iOS问题? 任何建议都表示赞赏。

1 个答案:

答案 0 :(得分:0)

ionic.tap.isElementTapDisabled= function(ele) {
                if (ele && ele.nodeType === 1) {
                  var element = ele;
                  while (element) {
                  // if ((element.dataset ? element.dataset.tapDisabled : element.getAttribute && element.getAttribute('data-tap-disabled')) == 'true') {
                      if (element.getAttribute && element.getAttribute('data-tap-disabled') == 'true') {
                      return true;
                    }
                    element = element.parentElement;
                  }
                }
                return false;
              };