Angularjs 当前边界形成google地图和ng地图
我使用的是:ngmap.github.io和离子框架 我试着像下面的js代码一样获得当前职位:Angularjs 当前边界形成google地图和ng地图,angularjs,google-maps,ionic,ng-map,Angularjs,Google Maps,Ionic,Ng Map,我使用的是:ngmap.github.io和离子框架 我试着像下面的js代码一样获得当前职位: google.maps.event.addListener(map, 'idle', function(){ var bounds = map.getBounds(); //returns an object with the NorthEast and SouthWest LatLng points of the bounds }); 如何将此代码转换为angularjs?根据: Ng
google.maps.event.addListener(map, 'idle', function(){
var bounds = map.getBounds();
//returns an object with the NorthEast and SouthWest LatLng points of the bounds
});
如何将此代码转换为angularjs?根据:
NgMap.getMap()。然后(函数(map){…})
用于获取映射实例
示例
var-app=angular.module('myapp',['ngMap']);
应用程序控制器('mapcntrl',函数(NgMap,$scope){
NgMap.getMap().then(函数(map){
log(map.getBounds().toString());
});
});代码>