deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Is it possible to use IconLayer for HTML based Icon?

Open winston-bosan opened this issue 8 years ago • 5 comments

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:

  1. Access the map object directly from react-map-gl and implement HTML markers there
  2. 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?

winston-bosan avatar Apr 24 '18 03:04 winston-bosan

You may be looking for http://uber.github.io/react-map-gl/#/Documentation/api-reference/marker

Pessimistress avatar Apr 24 '18 04:04 Pessimistress

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 avatar Apr 25 '18 16:04 winston-bosan

@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 avatar Apr 25 '18 17:04 ibgreen

@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).

winston-bosan avatar Apr 26 '18 15:04 winston-bosan

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

ibgreen avatar Apr 26 '18 15:04 ibgreen