title: Using Transcrypt with Leaflet Maps
body: <p>I love Python, and have never much cared for JavaScript.  So I was pretty excited to learn about Transcrypt.  I recently started a web-based project that uses Django for the back-end and a Leaflet map (specifically Esri Leaflet) that plays a central role in the front-end.  I'm trying to figure out if Transcrypt is a good fit for my project.  However, the documentation and examples on Transcrypt's website are either too simple or delve into more advanced topics too quickly.  As a result, I'm having a hard time deciding whether Transcrypt will add anything positive to my project or will simply bring more complexity and bugs.  I'd rather not spend several hours trying to get Transcrypt working (time that could be productively spent simply writing JavaScript) only to find out Transcrypt isn't a good fit for my website.  So I have a few questions.</p>
  
  <p>I know Transcrypt is designed to work with any JavaScript library.  Will it also work with map-based GIS libraries?  </p>
  
  <p>For example, if I can successfully encapsulate the whole of Esri Leaflet (but maybe I won't be able to?), Transcrypt would allow me to write the following in Python?</p>
  
  <pre><code>  var map = L.map('map').setView([40.91, -96.63], 4);
  
    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      attribution: '&amp;copy; &lt;a href="https://osm.org/copyright"&gt;OpenStreetMap&lt;/a&gt; contributors'
    }).addTo(map);
  
    var arcgisOnline = L.esri.Geocoding.arcgisOnlineProvider();
  
    L.esri.Geocoding.geosearch({
      providers: [
        arcgisOnline,
        L.esri.Geocoding.mapServiceProvider({
          label: 'States and Counties',
          url: 'https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer',
          layers: [2, 3],
          searchFields: ['NAME', 'STATE_NAME']
        })
      ]
    }).addTo(map);
  </code></pre>
  
  <p>By the way, that code was taken from <a href="https://esri.github.io/esri-leaflet/examples/search-map-service.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I didn't quite understand the explanations about integrating with JavaScript libraries found <a href="https://www.transcrypt.org/docs/html/integration_javascript.html#three-ways-of-integration-with-javascript-libraries" rel="nofollow noreferrer">here</a>, specifically where it says:</p>
  
  <blockquote>
    <p>Another way is to encapsulate the JavaScript library as a whole in a Transcrypt module. In the distribution this is done for the fabric module, that encapsulates fabric.js and is imported in the Pong example. In this way the global namespace stays clean.</p>
  </blockquote>
  
  <p>So I can't really tell if Transcrypt could handle all the GIS and map stuff.</p>
  
  <p>The Leaflet map will be the main user interface for my site. So knowing that Transcrypt could encapsulate it is kind of important.  There will also be a lot of event listeners connected to the map, and data going back and forth between the front and back-ends. I'm probably going to be using jQuery's Ajax for a lot of that.  I saw a few simple jQuery examples on the Transcrypt website, but am not sure if Transcrypt is really up to the job yet.</p>
  
  <p>I've noticed that the only person answering the Transcrypt questions is its creator, Jacques de Hooge.  I guess my questions are really directed at him.  Any advice you can offer me is much appreciated, Jacques!</p>