0
Google지도 Nicolas Laplante google-maps (http://nlaplante.github.io/angular-google-maps/) 모듈을 사용하고 있습니다. 내가 비동기 호출에서 센터 속성에 대한 좌표를 전달할 때 문제가 :
이 내 컨트롤러 :
app.controller('baznaCtrl',function($scope,$routeParams,$http){
$scope.idB=$routeParams;
$scope.latitude=0;
$scope.longitude=0;
$http.get('https://my web service/json/'+$scope.idB.lokid).success(function(data){
$scope.bs=data;
$scope.latitude=$scope.bs.lattitude.replace(',','.');
$scope.longitude=$scope.bs.longitude.replace(',','.');
});
angular.extend($scope,{
center : {
latitude: $scope.latitude,
longitude:$scope.longitude
},
markers:[],
zoom: 8
});
});
구글 맵 데이터가 $http
전화에서 오는 때 센터 숙박 시설의 변경하지 않는 것 같다. 항상 0,0입니다 (초기 값이 $scope.latitude
및 $scope.longitude
이므로).
당신은 내가 공장에서 $ HTTP 호출을 넣고 구글지도 센터 속성에 대한 약속으로 데이터를 사용 할 것을 제안 :
는이 예제를 참조하십시오
? – Tomislav공장에서 $ http 전화를 걸어! 감사 – Tomislav