Skip to content

onDragend and getting the new LatLng of the center of the map #359

@matgargano

Description

@matgargano

I've a basic map...

<Map
        google={google}
        zoom={13}
        style={mapStyles}
        initialCenter={userCoordinates}
        onClick={this.onMapClick}
        styles={style}
        onDragend={this.centerMoved}
      />

thing to note is the onDragend property... I have it mapped to fire this.centerMoved... which is defined as such. I can't seem to figure out how to get the new map's Lat and Lng at this point...

centerMoved = (mapProps, map) => {
    console.log(mapProps.google.maps.LatLng()); // returns undefined
};

Is there any way to get this information? Am I using the wrong event?

Metadata

Metadata

Assignees

No one assigned

    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