Late but I thought someone like me may get some help so adding the answer.
The current release doesn't support it so you will need to make some changes to the current node_module. See this url:
https://github.com/SebastianM/angular-google-maps/pull/991
willshowell has explained what needs to be done.
Steps:
- Update the sebm to agm (take the current release as of now)
- Second, update your angular to at least 2.3 because it will not work with 2.0.
- In the link above, he has committed various files to the branch. What he has done, is already explained in the issue.
- Short explanation: he has changed the Array to MVCArray so you can get the exact data type which google uses for it's map paths, added getPath() and getPaths() functions. I did same for Polygons you can download the files here to see what I need to change for getting new Paths for Polygons after DragEnd Dropbox link for files changed in @agm module
Once you have made changes to Node Module, you can use the following code in the mouse up event of your PolyGon:
@ViewChildren(AgmPolygon)
polygonData: QueryList;
polyMouseUp($event: any, index:number, polygon: any) {
var i =0;
this.polygonData.forEach(
x =>{
if(i==index){
x.getPath().then((y: any[]) => {
console.log('-');
y.forEach(z => console.log(z.lat(), z.lng()));
});
}
i++;
}
);
}