javascript - Google Visualization API - Geomap regions for Germany - Stack Overflow

After the release of new geomap package version I seem to have aproblem using geomap for German region

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?

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?

Share Improve this question edited May 26, 2011 at 13:44 Bill the Lizard 406k212 gold badges574 silver badges892 bronze badges asked May 22, 2011 at 9:06 MichalMichal 1011 silver badge3 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Use the resolution option parameter

options['resolution'] = 'provinces';

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.

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/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744339785a4569333.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信