Skip to content

Commit

Permalink
feat: fire google-map-bounds_changed event when map bounds change
Browse files Browse the repository at this point in the history
  • Loading branch information
paodb authored and javier-godoy committed Oct 3, 2023
1 parent 013bd71 commit 45cb54c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions google-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ Polymer({
* @event google-map-idle
*/

/**
* Fired when the viewport lat/lng bounds change.
*
* @event google-map-bounds_changed
*/

/**
* Polymer properties for the google-map custom element.
*/
Expand Down Expand Up @@ -999,6 +1005,10 @@ Polymer({
this._dragEventsChanged();
this._mouseEventsChanged();
this._idleEvent();

google.maps.event.addListener(this.map, 'bounds_changed', () => {
this.fire('google-map-bounds_changed', this.map.getBounds());
});
},

_clearListener(name) {
Expand Down

0 comments on commit 45cb54c

Please sign in to comment.