这是我目前的code时的界限,改变了被称为和作品:
This is my current code which is called when bounds are changed and works:
scope.boundsChanged= function(arg){
console.log(arg);
};
基本上,我需要lat和液化天然气的新阵列时上面这个函数被调用。我不确定是检索。
I basically need the new array of lat and lng when this function above is called. I'm unsure are the retrieve it.
我在一家指令采用了棱角分明的版本1使用JavaScript使用templateUrl。
I'm using angular version 1 with JavaScript in a directive using a templateUrl.
界控制台日志图精氨酸:
我不知道究竟是什么在boundsChanged()函数返回,但假设改变的界限,在函数返回的,方法是相同的获得纬度,经度坐标:
I dont know exactly what is returned in the boundsChanged() function, but assuming changed bounds are returned in the function, method is the same to get lat, lng coordinates:
scope.boundsChanged= function(arg){
//assuming changed bounds is returned as the 'arg'
var polygonBounds = arg;
var coordinates = [];
for (var i = 0; i < polygonBounds.length; i++)
{
coordinates.push({lat: polygonBounds.getAt(i).lat(), lng: polygonBounds.getAt(i).lng()});
coordinates.push(new google.maps.LatLng(polygonBounds.getAt(i).lat(), polygonBounds.getAt(i).lng()));
}
console.log(arg);
};