We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cfdc8d6 commit ac243e5Copy full SHA for ac243e5
src/google_map.js
@@ -130,6 +130,7 @@ export default class GoogleMap extends Component {
130
constructor(props) {
131
super(props);
132
this.mounted_ = false;
133
+ this.initialized_ = false;
134
135
this.map_ = null;
136
this.maps_ = null;
@@ -318,6 +319,12 @@ export default class GoogleMap extends Component {
318
319
}
320
321
_initMap = () => {
322
+ // only initialize the map once
323
+ if (this.initialized_) {
324
+ return;
325
+ }
326
+ this.initialized_ = true;
327
+
328
const propsCenter = latLng2Obj(this.props.center || this.props.defaultCenter);
329
this.geoService_.setView(propsCenter, this.props.zoom || this.props.defaultZoom, 0);
330
0 commit comments