Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 当前边界形成google地图和ng地图_Angularjs_Google Maps_Ionic_Ng Map - Fatal编程技术网

Angularjs 当前边界形成google地图和ng地图

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

我使用的是: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?

根据:

NgMap.getMap()。然后(函数(map){…})
用于获取映射实例

示例

var-app=angular.module('myapp',['ngMap']);
应用程序控制器('mapcntrl',函数(NgMap,$scope){
NgMap.getMap().then(函数(map){
log(map.getBounds().toString());
});
});