我正在制作基于标记的Google地理广告。但是需要花费大量时间来加载整个城市数据。
我的代码 的 HTML
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCXy0BKw58SlhIj-KHgtu3IGSk8JV8X2JI" type="text/javascript"></script>
<div id="regions_div" style="width: 900px; height: 500px;"></div>
的Javascript
<script>
google.charts.load('current', {
callback: function () {
var data = new google.visualization.DataTable(jsonp.json);
});
var options = {
region: 'US',
displayMode: 'markers',
colorAxis:{
minValue: 0,
maxValue:600,
colors:['#106393','#F4FB94']
},
resolution: 'provinces'
};
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(data, options);
},
packages:['geochart']
});
jsonp.json 我有1000左右没有。行或数据。
{
cols: [{id: 'A', label: 'City', type: 'string'},
{id: 'B', label: 'Occurances', type: 'number'},
],
rows: [{c:[{v: 'new york'},
{v: 555},
]},
{c:[{v: 'salt lake city'},
{v: 541},
]},
{c:[{v: 'charlottesville'},
{v: 333},
]}
],
}
有没有办法加载它?
任何帮助将不胜感激。
提前致谢:)