Is it possible to use IconLayer for HTML based Icon?
Currently, the IconLayer of deckgl supports only image based icons. And I am looking for a solution to implement interactive markers within the uber react-map-gl wrapper.
I am looking at two options as to avoid reinventing the wheel:
- Access the map object directly from react-map-gl and implement HTML markers there
- Rewrite the IconLayer by subclassing it
Which one would you recommend? If this feature is something that the team/community had in mind or had implemented yourself, how did you do it?
You may be looking for http://uber.github.io/react-map-gl/#/Documentation/api-reference/marker
Ah, it does work. But when I tried it out, there were severe performance issues with html markers implemented this way. It starts to be rather unusable about 1000 markers in, and I intend to display a large set of data as dynamic markers. Which is why I was drawn to the icon/scatterplot layer to do the heavy lifting.
@winston-bosan There is a new TextLayer in deck.gl v5.2. Depends on how your HTML looks, but maybe it can do part of what you need?
@ibgreen After your suggestion and reading through the new text-layer and font-atlas, it indeed can do part of what I need! In fact, perhaps writing a child class of multiicon layer is the better solution.
If I may ask, though this is possibly not the best place, how would one implement leaflet's supercluster in react-map-gl? There are examples of it back in the mapbox.js days. But if I remember correctly, mapbox-gl still uses the leaflet clustering and spiderfifying for its own clustering. How would one go about it to make something like this for react-map-gl? (Will move the issue to react-map-gl if it gets any longer).
how would one implement leaflet's supercluster in react-map-gl?
@winston-bosan Do you mean something like what happens when you zoom on http://uber.github.io/deck.gl/#/examples/core-layers/icon-layer
Source at https://github.com/uber/deck.gl/tree/5.2-release/examples/website/icon