-
Notifications
You must be signed in to change notification settings - Fork 837
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
Markers are jumping #1143
Comments
@pdwrl Could you provide an example of your code, and which version of this library you're using? |
@pdwrl @itsmichaeldiego
|
@Exilent-aby yes, Your fork reproduces the jumping. |
@itsmichaeldiego please, look at this sandbox |
@pdwrl, I have the same problem! SOS |
I agree, It would be nice to make this work again 😀 |
@pdwrl For now, I have downgraded to react 17 to make it work for my case. Personally, I don't want to move away from this library, as I found this to be the most straightforward approach to implementing google maps in react so far. |
oh, I can't downgrade. |
This problem seems to be happening in many implementations of Google Maps with react. The official google map react wrapper (@googlemaps/react-wrapper) has this demo listed in their documentation on npmjs.com. But they too seem to be using ReactDom.render with react 18 to make it work, at least this is what the console shows. We might have to wait a little longer for this issue to be fixed. |
Same problem here. Any updates? |
Same problem. We use React 18 in production and can't downgrade. |
@mcgrealife the PR of @bordeo address issues with react 18, but I've found out that something else happens: |
NextJS with React 18, same bug |
@pdwrl can you make your lat, lng values are present? i had one marker which was missing lng value and when I fixed that markers didn't jump anymore. |
@haabnaseem Can you explain more, these details are mandatory, we do provide them, however, we still face the same issue, |
React 18. Same bug googleMapReact18Bug.mp4 |
@giorgiabosello ah I see. The new google maps beta "Advanced Markers" look promising for most cases. I imagine these play well with the official @googlemaps/react-wrapper. |
@mcgrealife at the end, I didn't use the official @googlemaps/reactwrapper, since it is only a wrapper that calls the API script. It doesn't accept markers as react components, but only the default one. |
Hey there guys. |
Same problem. |
1 similar comment
Same problem. |
Any word on what's causing this? Why does reverting to react 17 fix it? |
@Naught0 because React 18, in developer mode, mount and unmount the component to make some tests. |
Nope, i tried in production mode but this behaviour still present |
You can use the parameter onGoogleApiLoaded, to have the reference to the map and add the markers, these markers will not have the problem
|
I've made a repository myself which is working with React 18. I've abandoned this one, since it seems it is not maintained anymore. |
Thanks, finally it's working |
@giorgiabosello What about draggable markers in there? Looks like it is not supported in the same way with draggable + onChildMouseUp + onChildMouseMove props |
Not managed, if you want to help with a PR, it's appreciated :) |
Hello, I have this problem on my project (React 18, google-map-react 2.2.0). Will the PR of bordeo be merged? |
@neo0910 this PR fixes some things, but breaks some others. |
2023, the bug still exists |
Thank you! |
For anyone coming here, I highly recommend the repo linked above. We have fairly easily migrated with only some changes (e.g. onDragEnd had to be implemented manually):
and there's no reactive
|
Same issue :( any updates? |
Same Issue |
import React from 'react'; ReactDOM.render( use this in your index.tsx/js it will act as react 17 and fix this bug |
@itsmichaeldiego great to know the library is still alive. |
same Issue :( , any update ? |
render map and marker. Note issue where marker moves around on rerenders: google-map-react/google-map-react#1143
same issue when i drap the map my current location marker moves. how can i fix this i,m using the react 18 and google-map-react |
Guys, there isn't a fix for this issue. It is how React18 works on developer mode. |
what do you suggest? I want to add the map the same as Uber. |
@Mu-Aleem there isn't much you can do:
|
giorgiabosello, first of all, thank you for using google-maps-react-markers. Everything works well without any jumps or flickers, but I have a need to change the center of the map after clicking on a marker. How can I achieve this? Thank you once again. |
@rise2vados this isn't the right thread. There's a discussion in the repository asking the same thing. Check there and you'll find your answer. :) |
You're amazing!!! Thank you so much |
Any updates??? |
#1197 (comment) this may help, give a try |
Any new updates please? |
still an issue 2024 even though their last release says supporting react 18, so i dont think react 18 had anything to do with it maybe @giorgiabosello. |
Yes, it does! Because it mounts and remounts the components, and the library doesn't work. It's old. |
the library is old yes, the library works but still has the jumpiness as you mentioned. |
2024, and still the same problem 🫠 |
Hello.
Markers are jumping only when navigating the map by mouse's dran'n'drop. They appears on their old places for a short time and then showing on a right places.
Strange: It doesn't reproduces on Codesandbox.
Any ideas please?
maps.mp4
The text was updated successfully, but these errors were encountered: