Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ozandndar opened this issue Sep 17, 2019 · 1 comment

Comments

@ozandndar
Copy link

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?

@rameshsyn
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants