mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
added this.props.center check (#174)
This commit is contained in:
parent
92ea1c43ec
commit
e1ab7f794b
@ -228,10 +228,14 @@ export default class GoogleMap extends Component {
|
||||
|
||||
if (this.map_) {
|
||||
const centerLatLng = this.geoService_.getCenter();
|
||||
if (nextProps.center) {
|
||||
if (this._isCenterDefined(nextProps.center)) {
|
||||
const nextPropsCenter = latLng2Obj(nextProps.center);
|
||||
const currCenter = latLng2Obj(this.props.center);
|
||||
const currCenter = this._isCenterDefined(this.props.center) ?
|
||||
latLng2Obj(this.props.center) :
|
||||
null;
|
||||
|
||||
if (
|
||||
!currCenter ||
|
||||
Math.abs(nextPropsCenter.lat - currCenter.lat) +
|
||||
Math.abs(nextPropsCenter.lng - currCenter.lng) > kEPS
|
||||
) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user