google / google-visualization-issues

288 stars 35 forks source link

Geomap regions missing for some countries #333

Open orwant opened 9 years ago

orwant commented 9 years ago
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
1. Create a new GeoMap
2. Set region option to  e.g. options['region'] = 'SE';
3. No regions are available inside the country

What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?

GeoMap

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by synthax on 2010-07-06 10:47:42

orwant commented 9 years ago
Hi, here you are an example of errors with Spain's Geomap regions. In this example,
 with the option options['dataMode'] = 'markers' everything is OK, but when the option
value is changed to 'regions' there are some regions left. Here you are the big and
short name of those regions (I don't know wich one will you use):
Principado de Asturias / Asturias
Cantabria / Cantabria
La Rioja / La Rioja
Comunidad Foral de Navarra / Navarra
Comunidad de Madrid / Madrid
Castilla-La Mancha / Castilla-La Mancha
Región de Murcia / Murcia
Islas Baleares / Islas Baleares

Thank you very much!

The code is:

<html>
<head>
  <script type='text/javascript' src='https://www.google.com/jsapi'></script>
  <script type='text/javascript'>
   google.load('visualization', '1', {'packages': ['geomap']});
   google.setOnLoadCallback(drawMap);

    function drawMap() {
      var data = new google.visualization.DataTable();
      data.addRows(17);
      data.addColumn('string', 'Comunidad Autónoma');
      data.addColumn('number', 'Población');
      data.setValue(0, 0, 'Andalucía');
      data.setValue(0, 1, 400);
      data.setValue(1, 0, 'Aragón');
      data.setValue(1, 1, 200);
      data.setValue(2, 0, 'Valencia');
      data.setValue(2, 1, 300);
      data.setValue(3, 0, 'Cantabria');
      data.setValue(3, 1, 100);
      data.setValue(4, 0, 'Castilla y León');
      data.setValue(4, 1, 210);
      data.setValue(5, 0, 'Castila-La Mancha');
      data.setValue(5, 1, 211);
      data.setValue(6, 0, 'Cataluña');
      data.setValue(6, 1, 310);
      data.setValue(7, 0, 'Extremadura');
      data.setValue(7, 1, 110);
      data.setValue(8, 0, 'Islas Canarias');
      data.setValue(8, 1, 120);   
      data.setValue(9, 0, 'La Rioja');
      data.setValue(9, 1, 60);
      data.setValue(10, 0, 'Comunidad de Madrid');
      data.setValue(10, 1, 420);
      data.setValue(11, 0, 'Galicia');
      data.setValue(11, 1, 120);
      data.setValue(12, 0, 'Asturias');
      data.setValue(12, 1, 50);
      data.setValue(13, 0, 'Islas Baleares');
      data.setValue(13, 1, 50);
      data.setValue(14, 0, 'Murcia');
      data.setValue(14, 1, 90);
      data.setValue(15, 0, 'Navarra');
      data.setValue(15, 1, 80);
      data.setValue(16, 0, 'País Vasco');
      data.setValue(16, 1, 70);   

      var options = {};
      options['region'] = 'ES';
      options['dataMode'] = 'markers';
      options['width'] = 556;
      options['height'] = 347;

      var container = document.getElementById('map_canvas');
      var geomap = new google.visualization.GeoMap(container);
      geomap.draw(data, options);

    };

  </script>
</head>
<body>
    <div id='map_canvas'></div>
</body>
</html>

Original issue reported on code.google.com by miguelzunda on 2011-11-08 09:07:21

orwant commented 9 years ago
Internationally Cataluña / Catalunya is known as Catalonia for the sake of these Google
charts. Otherwise it won't show. 
Use:

<head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
     google.load('visualization', '1', {'packages': ['geochart']});
     google.setOnLoadCallback(drawMarkersMap);

instead and it woks quite nicely.
Anyone know how to just show 1 region at a time; using Spain including the Balearics,
makes the whole peninsula quite petit. Thanks in Advance. Ta.

Original issue reported on code.google.com by AhjKerr on 2015-02-18 14:52:54