android - Not able to add marker on Google map -
i developing application requires marker placed on google map. click event recognized when run code in chrome. however, touch event not recognized in android device testing code on.
i using ionic, angularjs , cordova hybrid app development.
my controller looks :
.controller('map', function($scope, uigmapgooglemapapi, uigmaplogger,sharedproperties){ uigmapgooglemapapi.then(function(maps) { $scope.map = { center: { latitude: 0, longitude: 0 }, zoom: 16 }; $scope.models = []; $scope.events = { click: function (map, eventname, handlerargs) { $scope.$apply(function () { $scope.models.push({ id: $scope.models.length, latitude: handlerargs[0].latlng.lat(), longitude: handlerargs[0].latlng.lng(), }); }); } }; }); })
the html file looks this:
<ui-gmap-google-map center='map.center' zoom='map.zoom' events="events"> <ui-gmap-markers models="models" coords="'self'" options="'options'"></ui-gmap-markers> </ui-gmap-google-map>
can provide me work around issue? appreciate !
setting coords map center did trick ! :d
<ui-gmap-google-map center='map.center' zoom='map.zoom' events="events"> <ui-gmap-marker coords="map.center" idkey="1" ng-cloak> </ui-gmap-marker> </ui-gmap-google-map>
Comments
Post a Comment