2016-03-15 41 views
0

我無法突出顯示「北美洲」。我已經嘗試了很多不同的東西,「大洲」,「分行道」等。如果我只想強調北美,該怎麼辦?Google GeoChart - 「Sub-Continents」

第一個示例不起作用。 我的第二個確實只強調了主要的大陸地區。

<html> 
 
<head> 
 
    <div id="regions_div" style="width: 900px; height: 500px;"></div> 
 
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js?sensor=false&callback=initialize"></script> 
 
    <script type="text/javascript" src="https://www.google.com/jsapi?sensor=false"></script> 
 
    <script type="text/javascript"> 
 
    google.charts.load('current', {'packages':['geochart']}); 
 
    google.charts.setOnLoadCallback(drawRegionsMap); 
 

 
    function drawRegionsMap() { 
 

 
    var data = google.visualization.arrayToDataTable([ 
 
       ['Region Code', 'Sub-Continent', 'Popularity'], 
 
       ['142', 'Asia', 0], 
 
       ['150', 'Europe', 900], 
 
       ['021', 'Northern America', 300], 
 
       ['013', 'Central America', 300], 
 
       ['005', 'South America', 900], 
 
       ['009', 'Oceania', 300], 
 
       ['002', 'Africa', 300] 
 
    ]); 
 

 
    var options = {resolution: 'sub-continents'}; 
 

 
    var chart = new google.visualization.GeoChart(document.getElementById('regions_div')); 
 

 
    chart.draw(data, options); 
 
    } 
 
</script> 
 
</html>

<html> 
 
<head> 
 
    <div id="regions_div" style="width: 900px; height: 500px;"></div> 
 
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js?sensor=false&callback=initialize"></script> 
 
    <script type="text/javascript" src="https://www.google.com/jsapi?sensor=false"></script> 
 
    <script type="text/javascript"> 
 
    google.charts.load('current', {'packages':['geochart']}); 
 
    google.charts.setOnLoadCallback(drawRegionsMap); 
 

 
    function drawRegionsMap() { 
 

 
    var data = google.visualization.arrayToDataTable([ 
 
       ['Region Code', 'Continent', 'Popularity'], 
 
       ['142', 'Asia', 0], 
 
       ['150', 'Europe', 900], 
 
       ['021', 'Northern America', 300], 
 
       ['013', 'Central America', 300], 
 
       ['005', 'South America', 900], 
 
       ['009', 'Oceania', 300], 
 
       ['002', 'Africa', 300] 
 
    ]); 
 

 
    var options = {resolution: 'continents'}; 
 

 
    var chart = new google.visualization.GeoChart(document.getElementById('regions_div')); 
 

 
    chart.draw(data, options); 
 
    } 
 
</script> 
 
</html>

回答

2

我想通了。

var options = { 
     resolution: 'subcontinents' 
    }; 
相關問題