Google Visualization API - 德国的地理地图区域
新的地理地图包版本发布后我似乎有一个 使用德国地区地理地图时出现问题。升级前的一切 似乎工作得很好。问题是如果我尝试同时展示 DE-BE 地区(柏林)和DE-BB(勃兰登堡) - 柏林地区 未显示。如果我删除区域 DE-BB,或用任何替换它 德国其他地区,例如DE-BY(拜仁),效果很好!
请找到下面的测试代码:
google.load('visualization', '1.1', {packages: ['geomap']});
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addRows(2);
data.addColumn('string', 'Country');
data.addColumn('number', 'Popularity');
data.setValue(0, 0, 'DE-BE');
data.setValue(0, 1, 200);
data.setValue(1, 0, 'DE-BB');
data.setValue(1, 1, 300);
var geochart = new google.visualization.GeoMap(document.getElementById('visualization'));
var options = {};
options['dataMode'] = 'regions';
options['region'] = 'DE';
geochart.draw(data, options);
}
google.setOnLoadCallback(drawVisualization);
您能给我提供任何支持或想法吗? 出问题了吗? 是否可以包含旧版本的 geomap 包 测试?
After the release of new geomap package version I seem to have a
problem using geomap for German regions. Before the upgrade everything
seemed to work just fine. The problem is that if I try to show both
the region DE-BE (Berlin) & DE-BB (Brandenburg) - the Berlin region is
not shown. If I delete the region DE-BB, or substitute it with any
other German region, for example, DE-BY (Bayern) it works fine!
Please find below test code:
google.load('visualization', '1.1', {packages: ['geomap']});
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addRows(2);
data.addColumn('string', 'Country');
data.addColumn('number', 'Popularity');
data.setValue(0, 0, 'DE-BE');
data.setValue(0, 1, 200);
data.setValue(1, 0, 'DE-BB');
data.setValue(1, 1, 300);
var geochart = new google.visualization.GeoMap(document.getElementById('visualization'));
var options = {};
options['dataMode'] = 'regions';
options['region'] = 'DE';
geochart.draw(data, options);
}
google.setOnLoadCallback(drawVisualization);
Could you please provide me with any support or ideas what might have
gone wrong?
Is it possible to include the old version of geomap package for
testing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用分辨率选项参数
此外,API 现在具有新的 GeoChart 格式,它为您提供更多自定义功能,例如更改背景颜色以匹配您的网站主题。
Use the resolution option parameter
Also the api now has a new GeoChart format which gives you even more customization such as changing the background color to match your website theme.
我会研究 jvector 地图。它有德国的 SVG 地图,并且非常容易实现。我在地理地图方面遇到了很多问题,尤其是在旧版本的 IE 中。
http://jvectormap.owl-hollow.net/
I would look into jvector map. It has an SVG map of Germany and is super easy to implement. I had a lot of issues with geomap especially in old versions of the IE.
http://jvectormap.owl-hollow.net/