I'm using Ionic Framework b14, and the latest ngmap,
I have a view that shows the map but when I want to set the center it does not show the coordinates I'm getting from a service.
(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);
}());
I suppose is has to be something with the time it takes the server to respond, but I have no idea how to fix it, any help you can give me.
thanks.