Aisling
unread,Mar 23, 2011, 7:20:54 AM3/23/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Visualization API
I would like to point out some strange behaviour around displaying
Taiwan and China on the geomap visualisation.
If you set China to be the region (region: 'CN'), it highlights
Taiwan, and doesn't highlight China - instead dividing it into
regions.
Also, when you select Taiwan to be the region to center on, it
highlights Taiwan, then when you mouse over Taiwan, it highlights
China too. When you highlight China it doesn't highlight Taiwan.
I know there might be some political issues here, but I would like the
highlighting to be more consistent.
Regards,
Aisling.
------ Most basic code needed to see this behaviour - load it up and
click on China or Taiwan ------
var geomap;
var data;
var options = {dataMode : 'regions', region: 'world'};
function drawVisualization() {
data = new google.visualization.DataTable();
data.addRows(6);
data.addColumn('string', 'Country');
data.addColumn('number', 'Popularity');
data.setValue(0, 0, 'Germany');
data.setValue(0, 1, 200);
data.setValue(1, 0, 'United States');
data.setValue(1, 1, 300);
data.setValue(2, 0, 'Brazil');
data.setValue(2, 1, 400);
data.setValue(3, 0, 'Canada');
data.setValue(3, 1, 500);
data.setValue(4, 0, 'France');
data.setValue(4, 1, 600);
geomap = new google.visualization.GeoMap(
document.getElementById('visualization'));
geomap.draw(data, options);
google.visualization.events.addListener(geomap, 'regionClick',
regionHandler);
}
function regionHandler(e){
options.region=e['region'];
geomap.draw(data, options);
}