Leaflet icon indicating copy to clipboard operation
Leaflet copied to clipboard

Add content and latlng while initializing of Popup / Tooltip

Open Falke-Design opened this issue 3 years ago β€’ 5 comments

DivOverlay (Popup & Tooltip) supports now content in the options:

L.popup({content: 'Test'});

instead of

L.popup()
    .setContent('Test')

And it is now possible to pass an latlng point and the options as second parameter while creation:

var popup = L.popup(latlng, options?).addTo(map);

instead of

var popup = L.popup()
    .setLatLng(latlng)

This two new things together makes the usage of standalone popup / tooltip easier:

L.popup(latlng, {content: 'Test'}).addTo(map);

Falke-Design avatar Nov 14 '21 14:11 Falke-Design

I see here some unrelated (but useful additions). Wouldn't it be better to open separate PR for them?

johnd0e avatar Nov 15 '21 09:11 johnd0e

Both makes the useage of popup and tooltip standalone easier, this is theier relation

Falke-Design avatar Nov 15 '21 09:11 Falke-Design

this is theier relation

I expect relation to subject, which is defined it PR's title.

johnd0e avatar Nov 15 '21 10:11 johnd0e

@Falke-Design do we want to keep this in the 1.9 milestone or can we move this forward? I'd like to start working on a release.

jonkoops avatar Jul 24 '22 12:07 jonkoops

@jonkoops it only needs a review from another maintainer like many other PRs. If you could do the review it would be great

Falke-Design avatar Jul 24 '22 12:07 Falke-Design