小编Ani*_*ula的帖子

标记点击事件无法在移动设备中使用

我为附近的美食广场创建了谷歌地图.在这个标记显示在浏览器中并可点击并给出信息窗口数据.但同样的东西来到移动,标记显示,当点击标记(点击标记)信息窗口数据不显示.我尝试了这么多论坛和改变了很多代码和调试,但我找不到解决方案.

foodFactory.js

var foodModule = angular.module('foodModule', []);
foodModule.factory("foodFactory", ['$rootScope', '$window','foodServices', 'localStorageService', '$state', '$ionicLoading','$stateParams', 
    function($rootScope,  $window, foodServices, localStorageService, $state, $ionicLoading, $stateParams, $cordovaGeolocation ) {

        var foodCourtmap = {};
        var marker = {};


        var directionsDisplay = new google.maps.DirectionsRenderer({'draggable': true });
        var directionsService = new google.maps.DirectionsService();

        foodCourtmap.centerOnMe = function() {
            initialize();               
      };


      //intialze the google map it's show current location.
    function initialize() {

          var infowindow = new google.maps.InfoWindow(); 

                navigator.geolocation.getCurrentPosition(function(pos) {

                foodCourtmap.latitude = pos.coords.latitude;
                foodCourtmap.longitude = pos.coords.longitude;

                var …
Run Code Online (Sandbox Code Playgroud)

google-maps infowindow google-maps-api-3 angularjs ionic

0
推荐指数
1
解决办法
3051
查看次数