Download data on click via leaflet webmap Planned maintenance scheduled April 17/18, 2019 at...

Is it a good idea to use CNN to classify 1D signal?

Can you use the Shield Master feat to shove someone before you make an attack by using a Readied action?

Is there such thing as an Availability Group failover trigger?

What font is "z" in "z-score"?

How do I make this wiring inside cabinet safer? (Pic)

Is the Standard Deduction better than Itemized when both are the same amount?

If a VARCHAR(MAX) column is included in an index, is the entire value always stored in the index page(s)?

Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?

Is grep documentation wrong?

How to convince students of the implication truth values?

Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?

How can I use the Python library networkx from Mathematica?

Do square wave exist?

How to Make a Beautiful Stacked 3D Plot

また usage in a dictionary

How to compare two different files line by line in unix?

An adverb for when you're not exaggerating

Do I really need recursive chmod to restrict access to a folder?

Is CEO the profession with the most psychopaths?

Amount of permutations on an NxNxN Rubik's Cube

Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?

Maximum summed powersets with non-adjacent items

Is it fair for a professor to grade us on the possession of past papers?

How to deal with a team lead who never gives me credit?



Download data on click via leaflet webmap



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How to generate legend in leaflet webmap?Adding hyperlinks to Leaflet polylines created via Leaflet.Draw?Download data from webmap made with leafletMarkerCluster don't work with geojson layer in leafletWhat is leaflet-src.map?Why can't I load my basemap from the arcgis rest services using leaflet?leaflet not projecting tiles or feature layerHow to add select/deselect all layers button on the leaflet webmap created via qgis2web plugin?Joining CSV to KML/GeoJSON in Leaflet webmap and showing joined data in popups?leaflet search control not showing up in geodjango app





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am working on a webmap which will allow users to click on a portion of the globe and download associated river data. Here is my code so far.



<!DOCTYPE html>
<html>
<head>
<title>GRWL test</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"
integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"
integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
crossorigin=""></script>
<style>
#mapid {
height: 1920px;
width: 1080px;
}
</style>

<script src="leaflet-src.js"></script>
<script type="text/javascript" src="../dist/leaflet.ajax.js"></script>
<script src="spin.js"></script>
<script src="leaflet.spin.js"></script>

</head>
<body>

<div id="mapid"></div>
<script>

var map = L.map('mapid').setView([0.478320099108, -79.381377894799996], 14);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
maxZoom: 18,
id: 'mapbox.streets',
accessToken: 'pk.eyJ1IjoiamltbXlzd2lzaGVyIiwiYSI6ImNqc29vYW02ejAxYjI0YW94NnBlcDhpYWEifQ.6DiOztwTzMJu3eBEyHHfrw'
}).addTo(map);

function popUp(f,l){
var out = [];
if (f.properties){
for(key in f.properties){
out.push(key+": "+f.properties[key]);
}
l.bindPopup(out.join("<br />"));
}
}
var jsonTest = new L.GeoJSON.AJAX(["tiles.geojson"],{onEachFeature:popUp}).addTo(map);
</script>
</body>
</html>


This code outputs a grid system over the basemap as illustrated below, what I am confused on is how to incorporate the download tag or an on click event to download a shapefile stored locally when a user clicks a tile.
Output of the code









share





























    0















    I am working on a webmap which will allow users to click on a portion of the globe and download associated river data. Here is my code so far.



    <!DOCTYPE html>
    <html>
    <head>
    <title>GRWL test</title>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"
    integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
    crossorigin=""/>
    <script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"
    integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
    crossorigin=""></script>
    <style>
    #mapid {
    height: 1920px;
    width: 1080px;
    }
    </style>

    <script src="leaflet-src.js"></script>
    <script type="text/javascript" src="../dist/leaflet.ajax.js"></script>
    <script src="spin.js"></script>
    <script src="leaflet.spin.js"></script>

    </head>
    <body>

    <div id="mapid"></div>
    <script>

    var map = L.map('mapid').setView([0.478320099108, -79.381377894799996], 14);
    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
    maxZoom: 18,
    id: 'mapbox.streets',
    accessToken: 'pk.eyJ1IjoiamltbXlzd2lzaGVyIiwiYSI6ImNqc29vYW02ejAxYjI0YW94NnBlcDhpYWEifQ.6DiOztwTzMJu3eBEyHHfrw'
    }).addTo(map);

    function popUp(f,l){
    var out = [];
    if (f.properties){
    for(key in f.properties){
    out.push(key+": "+f.properties[key]);
    }
    l.bindPopup(out.join("<br />"));
    }
    }
    var jsonTest = new L.GeoJSON.AJAX(["tiles.geojson"],{onEachFeature:popUp}).addTo(map);
    </script>
    </body>
    </html>


    This code outputs a grid system over the basemap as illustrated below, what I am confused on is how to incorporate the download tag or an on click event to download a shapefile stored locally when a user clicks a tile.
    Output of the code









    share

























      0












      0








      0








      I am working on a webmap which will allow users to click on a portion of the globe and download associated river data. Here is my code so far.



      <!DOCTYPE html>
      <html>
      <head>
      <title>GRWL test</title>
      <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"
      integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
      crossorigin=""/>
      <script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"
      integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
      crossorigin=""></script>
      <style>
      #mapid {
      height: 1920px;
      width: 1080px;
      }
      </style>

      <script src="leaflet-src.js"></script>
      <script type="text/javascript" src="../dist/leaflet.ajax.js"></script>
      <script src="spin.js"></script>
      <script src="leaflet.spin.js"></script>

      </head>
      <body>

      <div id="mapid"></div>
      <script>

      var map = L.map('mapid').setView([0.478320099108, -79.381377894799996], 14);
      L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
      attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
      maxZoom: 18,
      id: 'mapbox.streets',
      accessToken: 'pk.eyJ1IjoiamltbXlzd2lzaGVyIiwiYSI6ImNqc29vYW02ejAxYjI0YW94NnBlcDhpYWEifQ.6DiOztwTzMJu3eBEyHHfrw'
      }).addTo(map);

      function popUp(f,l){
      var out = [];
      if (f.properties){
      for(key in f.properties){
      out.push(key+": "+f.properties[key]);
      }
      l.bindPopup(out.join("<br />"));
      }
      }
      var jsonTest = new L.GeoJSON.AJAX(["tiles.geojson"],{onEachFeature:popUp}).addTo(map);
      </script>
      </body>
      </html>


      This code outputs a grid system over the basemap as illustrated below, what I am confused on is how to incorporate the download tag or an on click event to download a shapefile stored locally when a user clicks a tile.
      Output of the code









      share














      I am working on a webmap which will allow users to click on a portion of the globe and download associated river data. Here is my code so far.



      <!DOCTYPE html>
      <html>
      <head>
      <title>GRWL test</title>
      <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"
      integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
      crossorigin=""/>
      <script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"
      integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
      crossorigin=""></script>
      <style>
      #mapid {
      height: 1920px;
      width: 1080px;
      }
      </style>

      <script src="leaflet-src.js"></script>
      <script type="text/javascript" src="../dist/leaflet.ajax.js"></script>
      <script src="spin.js"></script>
      <script src="leaflet.spin.js"></script>

      </head>
      <body>

      <div id="mapid"></div>
      <script>

      var map = L.map('mapid').setView([0.478320099108, -79.381377894799996], 14);
      L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
      attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://mapbox.com">Mapbox</a>',
      maxZoom: 18,
      id: 'mapbox.streets',
      accessToken: 'pk.eyJ1IjoiamltbXlzd2lzaGVyIiwiYSI6ImNqc29vYW02ejAxYjI0YW94NnBlcDhpYWEifQ.6DiOztwTzMJu3eBEyHHfrw'
      }).addTo(map);

      function popUp(f,l){
      var out = [];
      if (f.properties){
      for(key in f.properties){
      out.push(key+": "+f.properties[key]);
      }
      l.bindPopup(out.join("<br />"));
      }
      }
      var jsonTest = new L.GeoJSON.AJAX(["tiles.geojson"],{onEachFeature:popUp}).addTo(map);
      </script>
      </body>
      </html>


      This code outputs a grid system over the basemap as illustrated below, what I am confused on is how to incorporate the download tag or an on click event to download a shapefile stored locally when a user clicks a tile.
      Output of the code







      leaflet javascript web-mapping html





      share












      share










      share



      share










      asked 7 mins ago









      M. C. GriffinM. C. Griffin

      84




      84






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f319205%2fdownload-data-on-click-via-leaflet-webmap%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f319205%2fdownload-data-on-click-via-leaflet-webmap%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

          Meter-Bus Содержание Параметры шины | Стандартизация |...