title: Handling map click with svelte-leaflet and get coordinates
body: <p>I am trying to find coordinates on map when user click on it, but not when he double click to zoom in. The goal being to create a marker at this point and remember it for later.</p>
  <p>As I am using svelte, I believe i should use a premade svelte module, I found <a href="https://ngyewch.github.io/svelte-leaflet/getting-started" rel="nofollow noreferrer">svelte-leaflet</a> that should be able to do the job.</p>
  <p>I downloaded their <a href="https://github.com/ngyewch/svelte-leaflet-test" rel="nofollow noreferrer">sample project</a> and start editing from there.</p>
  <p>So I just want to get an event so far, so I create a function in <code>App.svelte</code></p>
  <pre class="lang-js prettyprint-override"><code>const on_map_click = (e) =&gt; {
          console.log('click')
          console.log(e)
      }
  </code></pre>
  <p>And add the event handler:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;example&quot; style=&quot;width: 100%; height: 100%;&quot;&gt;
      &lt;LeafletMap bind:this={leafletMap} options={mapOptions} on:click={on_map_click}&gt;
          &lt;TileLayer url={tileUrl} options={tileLayerOptions} /&gt;
      &lt;/LeafletMap&gt;
  &lt;/div&gt;
  
  </code></pre>
  <p>Unfortunately I don't get any event.</p>
  <p>So I tried another aproach (not svelte-oriented) :</p>
  <pre class="lang-js prettyprint-override"><code>    onMount(() =&gt; {
          leafletMap.getMap().fitBounds([[60.9, -4.8], [45.5, 10.2]]);
          leafletMap.getMap().on('click', on_map_click) // &lt;--- 
      });
  </code></pre>
  <p>This approach works, but if I double click it still trigger the event. So I believe there is another way, more adapted to the use case.</p>
  <p>Please let me know what I am doing wrong ?</p>