-
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
Comparison to Uber's react-map-gl #97
Comments
@alex3165 started to work on this library since While this means that we sometimes have to implement new features as opposed to
As you can see, the goals of the two libraries are quite different. I'm happy to give you more details on this, and I think @alex3165 can help you as well :) |
Hey @z0d14c to complete what @philpl said, this library aims to abstract |
Also I recently merged a PR which include a component Happy to hear the opinion of the community on this. |
Thanks so much @alex3165 @philpl for the timely replies. We don't currently leverage too many of the |
Yes And yes you can easily access to the mapbox instance, we pass the instance to every event, you also have an event at startup |
Thanks for your answers. I will close this question for now as you have been more than sufficient in responding to my concerns. I would say that it may be a good idea to have a FAQ question dealing with the comparison to uber's |
https://medium.com/@alex_picprod/an-efficient-webgl-map-with-mapbox-gl-js-and-react-mapbox-gl-4ac7f3d41570 <-- link to article refrenced above |
The articles mentioned above are pretty dated. Is there a more recent comparison table? We started with react-map-gl, but ran into quite some performance issues. Also, we're desperately needing cluster support, which On the other hand, we need some data visualization capabilities, like dynamically coloring countries or regions based on data (choropleth). I saw the comment on implementing this on top of In a nutshell, I am wondering if we should switch to |
@derwaldgeist dynamically coloring countries based on data should be simple with either lib – by plugging right into mapbox's native style API, with functions and whatnot. Wondering what the performance issues were that you have run into? What kind of features are you using currently? As for the original question, I don't know of a recent comparison doc. |
Thanks for your fast response. The performance is basically related to situations when there are a lot of markers visible on the map. Though we cache them and they are definitely not re-rendered, performance goes down drastically once the number exceeds 100 or so and try to pan the map. The |
@derwaldgeist what are you using the markers for? Markers are going to perform poorly on any mapbox wrapper/library. If you only need to display something like an icon or text, symbol layers are much, much more performant. |
We're using markers, because each of them has to be clickable. Is this possible with symbol layers? I haven't found a sample for this yet. |
Yeah, you don't need markers to make the map clickable. As a matter of fact, you don't even need to show anything on the map to make it clickable. Here's a related official example of reacting to clicks: https://docs.mapbox.com/mapbox-gl-js/example/queryrenderedfeatures-around-point/ The main gist is that when a click is detected, you ask mapbox for "what are the Features at that position that the user might have intended to click on?" and then get a list of features, from which you can find the intended one based on some logic, and then you can do whatever based on the click (show a popup, change some state, redirect etc). |
Will this work for features we've added as a GeoJSON layer? In this case, this would be great. We're not interested in generic features (i.e. those which are part of the base map), as we're overlaying the map with additional information. |
Yes, queryRenderedFeatures can return features at some screen coordinate from any layer. If you have more questions, please open a separate issue. |
if so, what were your findings?
for example we are skeptical of building the style object and passing it in to control everything instead of using the semantic style of this library. any and all thoughts would be helpful. sorry for hijacking the issues board, we hope to use this library if its appropriate for our needs (and would be contributing to it also).
The text was updated successfully, but these errors were encountered: