Skip to content

updating center from parent does not reposition map #546

Description

@asyncjason

sorry, I've searched and can't seem to find the answer.

I'm updating center of map from parent component but the map is not repositioning. What am I missing here?
Cheers

export class GMapReact extends Component {
    render() {
        console.log("center:", this.props.center);
        return (
            <GoogleMap
                bootstrapURLKeys={{ key: [GOOGLE_API_KEY] }}
                center={this.props.center}
                zoom={this.props.zoom}
            >
                {this.props.markers.map((marker, i) => {
                    return (
                        <MarkerComponent
                            key={i}
                            lat={marker.latitude}
                            lng={marker.longitude}
                            text={marker.name}
                        />
                    )
                })}
            </GoogleMap>
        );
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions