Hey everyone, 

I keep getting the error "TypeError: google.visualization.Map is not a 
constructor" when I am trying to render a Map. However when I change to  
google.visualization.GeoChart this error goes away. I have gone through 
several sites trying to find an answer for this but to no avail. 

Please help me with this. The code is below:

google.charts.load('current', {
           'packages': ['map'],
           'mapsApiKey': maps_API_key
        });
        google.charts.setOnLoadCallback(drawMarkersMap);
        function drawMarkersMap(){
            data = new google.visualization.DataTable();
            data.addColumn("string","Country");
            data.addColumn("number","Population");
            
            data.addRows([
                ['India',      2761477],
                ['Milan',     1324110],
                ['Naples',    959574],
                ['Turin',     907563],
                ['Russia',   655875],
                ['Genoa',     607906],
                ['Mumbai',   380181],
                ['Florence',  371282],
                ['Fiumicino', 67370],
                ['Anzio',     52192],
                ['Ciampino',  38262]
            ]);
            
            options = {
                zoomLevel: 2,
                showTooltip: true,
                showInfoWindow: true,
                useMapTypeControl: true,
            }
        
            var map = new 
google.visualization.Map(document.getElementById('chart_div_map'));
            map.draw(data, options);
        }

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/844e975f-5617-45af-8a41-d7f226fc5a20n%40googlegroups.com.

Reply via email to