added this.props.center check (#174)

This commit is contained in:
Stanislav Ermakov 2016-06-16 12:44:42 +03:00 committed by Ivan Starkov
parent 92ea1c43ec
commit e1ab7f794b

View File

@ -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
) {