Re: [Leaflet] simpleMapScreenshoter

36 views
Skip to first unread message

Edwin Corrigan

unread,
Sep 28, 2023, 6:36:30 PM9/28/23
to leafl...@googlegroups.com
Hi Jean Michel,

They seem to recommend two ways of triggering events:

Method one: Where you click a button as a leaflet control, for this you listen to an event on the Leaflet Map object. 

Method two: Where you listen to an event from a DOM element outside of a leaflet map. This is the case where you use the getDocumentById function, but you know the id because you specify it in the DOM yourself.

I put both methods as examples in this codepen - https://codepen.io/corrigancd/pen/bGOKLNe

Does this help?

On Wed, 27 Sept 2023 at 10:51, Jm d <jd020...@gmail.com> wrote:
Hello everyone

Is it possible to retrieve the ID of an L.simpleMapScreenshoter?

Here is my code :

 const pluginOptions = {hideElementsWithSelectors: [ ".leaflet-control-container",".leaflet-dont-include-pane"],hidden: true};

 Var ScreenCopy = new L.simpleMapScreenshoter(pluginOptions);

ScreenCopy.addTo(Rcarte);

document.getElementById( ????? ).addEventListener('click', function () {
ScreenCopy.takeScreen('blob', {........

Many thanks for your help

Jean Michel

--

---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/b3199a39-69c3-4f0f-8e23-bd8dd1db7269n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages