4 Replies Latest reply on Aug 19, 2019 8:12 AM by nicolas sinquin

    getMarksAsync give an error on map

    nicolas sinquin

      Hi,

       

      I'm using the following to capture events :

       

      <!DOCTYPE html>

      <html>

      <head>

          <title>TEST</title>

          <script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau-2.js"></script>

          <script type="text/javascript">

              function initViz() {

                  var containerDiv = document.getElementById("vizContainer");

                  // Create a viz object and embed it in the container div.

                var viz = new tableau.Viz(containerDiv, 'https://server/views/woorkbook/sheet', {

                      hideTabs: true,

                      onFirstInteractive: function () {

                          viz.addEventListener(tableau.TableauEventName.MARKS_SELECTION, onMarksSelection);

                      }

                  });

              }

       

              function onMarksSelection(marksEvent) {

                  return marksEvent.getMarksAsync().then(reportSelectedMarks);

              }

       

              function reportSelectedMarks(marks) {

                  var html = [];

                  for (var markIndex = 0; markIndex < marks.length; markIndex++) {

                      var pairs = marks[markIndex].getPairs();

                      console.log(pairs);

                  }

                  console.log(html);

              }

          </script>

      </head>

       

      <body onload="initViz();">

          <div id="vizContainer" style="width:800px; height:700px;"></div>

      </body>

       

      </html>

       

      In the example, I only put the a shapefile.

      That works fine exepted for the map... i tried many, but still an error Type. When i click on the code (in legend) no problem, "just" when i click on the map.

      In this example, I found the shapefile here  https://data.london.gov.uk/dataset/statistical-gis-boundary-files-london, and i attached a workbook.

       

      thanks for your help.