我正在使用 Ionic Framework b14 和最新的 ngmap,
我有一个显示地图的视图,但是当我想设置中心时,它不显示我从服务中获得的坐标。
(function() {
var injectParams = ['$scope', '$stateParams', 'storeFactory'];
var StoreController = function($scope, $stateParams, storeFactory) {
var id = $stateParams.storeId;
$scope.store;
storeFactory.getStore(id)
.success(function(store) {
$scope.store = store;
}).error(function(error) {
$scope.status = ' ' + error.message;
});
$scope.$on('mapInitialized', function(event, map) {
var myLatLng = new google.maps.LatLng(store.Latitude, store.Longitud);
map.setCenter(myLatLng);
});
};
StoreController.$inject = injectParams;
angular.module('elizondo').controller('StoreController', StoreController);
}());
我想这与服务器响应所需的时间有关,但我不知道如何解决它,您可以给我任何帮助。
谢谢。