How to make a custom control that is a React component & is clickable (v7.x) #1728
-
Based on my understanding of the documentation the The example provided in the repo uses an already-made custom control ( If instead I want to create a custom control that is also a React component there's no documented / straightforward way that I could find. While looking at the repo I found this other discussion that points to the custom-overlay example. Following the example just mentioned I am able to render my "control" React component as an overlay using The problem with this method is that I'm actually rendering an overlay on the map rather than an actual control and this also means I'm not able to interact with the control at all as there's no way (that I could find) to intercept click events. All events go straight to the map. My question is:
As alternative I'm rendering the component outside of the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Set the |
Beta Was this translation helpful? Give feedback.
-
Hey there, Note: to have the control appear at the correct place, I used the |
Beta Was this translation helpful? Give feedback.
-
In my opinion, it's easier create an absolute positioned div and put whatever component you want inside of it. |
Beta Was this translation helpful? Give feedback.
Set the
pointerEvents
CSS.