My goal is to incorporate the following code snippet:
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: { lat: -25.363, lng: 131.044 }
});
var source = Rx.Observable.fromEventPattern(
function (handler) {
return map.addListener('center_changed', handler);
},
function (handler, listener) {
google.maps.event.removeListener(listener);
}
);
source.subscribe(function () {
console.log(map.getCenter());
});
I have attempted various approaches, but I am encountering difficulty in configuring imports in a way that prevents errors related to "Rx.Observable.fromEventPattern".
Could someone please guide me on how to correctly set it up? I am using "rxjs": "~6.2.0" and Angular 6.
Thank you in advance
Hucho