Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make pointer of react-leaflet popup point to the marker?

How can I make the arrow on the pop-up box on a React-Leaftlet Popup point to the marker, instead of the bottom right of the box, as in the figure below?

enter image description here

Here is my code for the popup:

<Popup>
  <span>
    <p>Foo</p>
  </span>
</Popup>

I am using the Popup.js code from the react-leaflet repository examples folder. In that class, I don't see an option for setting an offset.

Even just removing that downward pointing arrow might be good enough.

Thanks,

like image 960
Shafique Jamal Avatar asked Mar 02 '18 03:03

Shafique Jamal


1 Answers

you can style the tip with leaflet-popup-tip css class. depending on your needs you can modify the position using css.

for example hiding the tip

.leaflet-popup-tip {
    display:none;
}
like image 113
Alex Parij Avatar answered Oct 04 '22 15:10

Alex Parij