diff --git a/src/google_map.js b/src/google_map.js index 2ceda7b..9ae8a5b 100644 --- a/src/google_map.js +++ b/src/google_map.js @@ -390,6 +390,8 @@ export default class GoogleMap extends Component { this_.updateCounter_++; this_._onBoundsChanged(map, maps, !this_.props.debounced); + this_._onGoogleApiLoaded({map, maps}); + div.style.left = `${ptxRounded.x}px`; div.style.top = `${ptxRounded.y}px`; if (this_.markersDispatcher_) { @@ -485,19 +487,6 @@ export default class GoogleMap extends Component { this_.dragTime_ = (new Date()).getTime(); this_._onDrag(); }); - - if (this.props.onGoogleApiLoaded) { - if (process.env.NODE_ENV !== 'production' && - this.props.yesIWantToUseGoogleMapApiInternals !== true ) { - console.warn( 'GoogleMap: ' + // eslint-disable-line - 'Usage of internal api objects is dangerous ' + - 'and can cause a lot of issues.\n' + - 'To hide this warning add yesIWantToUseGoogleMapApiInternals={true} ' + - 'to { console.error(e); // eslint-disable-line no-console @@ -505,6 +494,21 @@ export default class GoogleMap extends Component { }); } + _onGoogleApiLoaded = (...args) => { + if (this.props.onGoogleApiLoaded) { + if (process.env.NODE_ENV !== 'production' && + this.props.yesIWantToUseGoogleMapApiInternals !== true ) { + console.warn( 'GoogleMap: ' + // eslint-disable-line + 'Usage of internal api objects is dangerous ' + + 'and can cause a lot of issues.\n' + + 'To hide this warning add yesIWantToUseGoogleMapApiInternals={true} ' + + 'to this.props.onDrag && this.props.onDrag(...args);