Im trying to get a video inside a leaflet popup. The problem is that the width of the video is set on 560 and the default maxwidth of a popup is 300.
I found that there is an option maxWidth and minWidth in leaflet, but can't seem to get it working.
Below is the code that currently works, but is missing the width options;
goodVoteLayer.bindPopup('<object data="http://www.youtube.com/embed/W7qWa52k-nE" width="560" height="315"></object>');
This is a link to the leaflet docs on popups. http://leafletjs.com/reference-1.0.0.html#popup-option
Thank you in advance.
The second argument to bindPopup is the same options
that you would give to L.popup
, so you should be able to add max/minWidth like so:
goodVoteLayer.bindPopup('<object data="http://www.youtube.com/embed/W7qWa52k-nE" width="560" height="315"></object>', {
maxWidth : 560
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With