react-location-picker icon indicating copy to clipboard operation
react-location-picker copied to clipboard

Map and marker's place doesn't move when the lat,long state is changed by another component.

Open ozandndar opened this issue 6 years ago • 1 comments

When using only handleLocationChange, it works fine.

this.state = { address: 'Kala Pattar Ascent Trail, Khumjung 56000, Nepal', position: { lat: 0, lng: 0 }

handleLocationChange({ position, address, places }) { this.setState({ position, address }); }

but when it comes to set the states by another component, map marker and map doens't move. I can set the states without any problem but i need to change map markers place when i set the new lat,long.

My other component is below: onSuggestSelect(suggest) { let newLat = suggest.location.lat; let newLng = suggest.location.lng; let newAddress = suggest.label; let newProperties = { position: { lat: newLat, lng: newLng }, address: address, places: null };

this.handleLocationChange(newProperties);

}

Can any body have an idea about how can i change the map marker's place?

ozandndar avatar Sep 17 '19 14:09 ozandndar

Hey @ozandndar, Could you please paste your whole code for another component?

rameshsyn avatar Sep 20 '19 02:09 rameshsyn