Hello,

According to the ChartWrapper docs, the ChartWrapper handles loading all 
necessary libraries. If you have third party libraries then you must load 
them yourself explicitly.

   - ChartWrapper claiming to handle lading of all libraries here 
   
<https://developers.google.com/chart/interactive/docs/drawing_charts#chartwrapper>
   - ChartWrapper constructor options claiming that you must load 
   third-party libraries but not google.visualization libraries here 
   <https://developers.google.com/chart/interactive/docs/reference#drawchart>

I'm having problems loading a 'Map' chart type. When trying to load a map I 
receive the error 'object is not iterable (cannot read property 
Symbol(Symbol.iterator))' If I don't explicitly load the 'map' package. 
Here's an example piece of code that can be run to reproduce the issue.

<html>
  <head>
    <script type="text/javascript" 
src="https://www.gstatic.com/charts/loader.js";></script>
    <script type="text/javascript">
      google.charts.load('current');
      // google.charts.load('current', { packages: ['map']});
      google.charts.setOnLoadCallback(drawMap);

      function drawMap() {
        let mapWrapper = new google.visualization.ChartWrapper({
            chartType: 'Map',
            dataTable: [
              ['lattitude', 'longitude', 'label'],
              [-37.7647, 144.9393, 'hello'],
              [40.4165, -3.7026, 'hello2']
            ],
            options: {'title': 'Stuff'},
            container: document.getElementById('map_div')
        });

        mapWrapper.draw();
      }
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="map_div" style="width: 600px; height: 400px;"></div>
  </body>
</html>

If you run as-is, you will receive the error. If you uncomment the load 
call with the 'map' package then everything loads just fine. Is the Google 
Maps library considered a third-party library or is this a bug or am I 
missing something? Any help here would be greatly appriciated. Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/d60e446a-8709-410c-8141-a545899ed456n%40googlegroups.com.

Reply via email to