我想在GeoChart上显示标记https://developers.google.com/chart/interactive/docs/gallery/geochart?hl=it#marker-geocharts,如何使用mapsApiKey
指令在Google GeoChart中注入ng-google-chart
。
示例代码
var chart = {};
chart.type = "GeoChart";
chart.mapsApiKey = 'Generated API Key';
chart.data = [
['City', 'Population', 'Area'],
['Rome', 2761477, 1285.31],
['Milan', 1324110, 181.76],
['Naples', 959574, 117.27],
['Turin', 907563, 130.17],
['Palermo', 655875, 158.9],
['Genoa', 607906, 243.60],
['Bologna', 380181, 140.7],
['Florence', 371282, 102.41],
['Fiumicino', 67370, 213.44],
['Anzio', 52192, 43.43],
['Ciampino', 38262, 11]
];
chart.options = {
region: 'IT',
displayMode: 'markers',
colorAxis: {colors: ['green', 'blue']}
};
$scope.chartInfo = chart;
在HTML
中<div google-chart chart="chartInfo" id="chart"></div>
我正在传递 mapsApiKey 以及所有其他属性。 它始终显示 Google Maps API错误:MissingKeyMapError 。我需要准确注入 mapsApiKey ?