-
Notifications
You must be signed in to change notification settings - Fork 535
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
New version (5.0.0) does not show Features when loading the component for the first time #904
Comments
I am seeing this issue as well. I thought it had to do with the way I was loading the CSS, but I tried via an |
Markers works fine though... |
Only problem now is that when I downgrade back to 4.8.6 my |
Having the same issue. Changed back to 4.8.6 and it works again |
Same problem also fixed by moving to |
I can also confirm this. Installed |
Oof. Yeah, I haven't been able to dig into this any further to figure out what it could be. |
Me too. This issue is a breaking change and the map isn't fit for purpose at the moment in 5.0.0 so I would urge swift remediation. Especially if you're using something like the latest Next.JS which disallow global CSS import from node_modules so you can't just revert back to 4.8.6 |
@alex3165 I'm using Next.js. When I change a code that causes a hot reload on the map component ( example: changing the markers ) all the features are displayed properly, but as soon as I refresh the page all the features disappear from the map. |
Finally, I found the source of this issue. |
Encountered this issue as well on Next.js v10.0.1. I ended up copying the Not a long-term fix, but works for anybody who's encountering it. |
Gatsby wouldn't build with the older libraries -- see mapbox/mapbox-gl-js#4593 for full context. Note that dev mode worked. Avoided v5 of react-mapbox-gl as I encountered this bug: alex3165/react-mapbox-gl#904 This commit also adds updates the package-lock and removes a linting error which prevented TravisCI passing
Also having this problem with create react app 4, version 5.1.1 of this lib. |
Any updates with this? quite a breaking change, I've tried changing the map-events.ts file but that doesn't seem to fix the issue. |
@Georift a PR would be greatly appreciated indeed. Sorry about the silence, everybody. |
No worries! Appreciate the fast reply. I'll take a look into it this weekend. Current work around would be downgrading your local |
This is also a workaround, but I set onStyleLoad to change the zoomLevel an imperceptible amount and the features look like they load normally.
|
As @Mahdi-Esbati mentioned, the error stems from map-events.ts and I believe this is the errant line: 669bd38#diff-d2e7ea38f9a45638da94987edfdc9ac3a96fbeebe504301bc0d9b9825989a63fR139 The check should be:
The way i've fixed it in my use case is like this: #927 (comment) |
@wallstar Thanks for this tip! |
is there any update on this issue? |
The current workaround does not work with Next. Still no PR ??? This issue is really frustrating... |
@baedyl, it would be great if you could make a PR. Thanks for looking into it! |
@cloudlena I would love to make a PR fixing this issue... Unfortunately, all the workarounds provided in this thread (and others) don't seem to resolve the issue on our end. So, right now I have no clue how to solve this problem. |
For anyone coming across this issue, you can try using this react wrapper instead. It's a much better alternative and the markers are displayed correctly. |
You da goat for this - bless |
With version 4.8.6, everything works fine, but the latest version (5.0.0) does not show any Feature for any Layer when first rendering the Map component. However, after using an onClick event function on the Map, it can update the coordinates of a Feature and then the Feature appears on the map.
The text was updated successfully, but these errors were encountered: