【问题标题】:Info window not displaying on ng-click angularjs google map in android信息窗口未显示在 ng-click android 中的 angularjs 谷歌地图上
【发布时间】:2014-10-23 09:36:53
【问题描述】:

我正在尝试使用这个 js fiddle http://jsfiddle.net/svigna/pc7Uu/ 在 android 中实现谷歌地图。除了 infowindow 触摸事件外,一切正常。运行浏览器时可以正常工作,但在 android 设备中不能正常工作。这是在手机中不工作的代码。

google.maps.event.addListener(marker, 'ng-click', function(){
            infoWindow.setContent('<h2>' + marker.title + '</h2>' + marker.content);
            infoWindow.open($scope.map, marker);
        });

ng-click 无法在电话中使用。

【问题讨论】:

    标签: javascript android angularjs google-maps cordova


    【解决方案1】:

    没有ng-click 事件——它是指令。

    但你的小提琴似乎没问题。如果click 什么都不做,也尝试使用tap 事件。

    在 Angular 应用程序中使用非 Angular 服务很困难,因为 $digest 循环无法自行运行。考虑使用Angular Google Maps等专用服务。

    【讨论】:

    • 请说明您是否能够/不能打开 infoWindow 1) 点击市场 2) 点击地图下方的链接
    猜你喜欢
    • 1970-01-01
    • 2012-12-23
    • 1970-01-01
    • 1970-01-01
    • 2012-03-28
    • 1970-01-01
    • 2016-12-21
    • 2012-02-18
    • 1970-01-01
    相关资源
    最近更新 更多