this.map.getCenter() Cannot read property

SOLUTION:
use arrow function and when not , Coz of the function(){} you were not getting the scope of parent inside it , if you wan that you should use () => {}

google.maps.event.addListener(this.map, 'center_changed', () => {
    alert(this.map.getCenter());
});
1 Like