events with Geomap - How to change from World view to Country View.

103 views
Skip to first unread message

Marcel Olmo

unread,
Jan 27, 2011, 12:41:52 PM1/27/11
to Google Visualization API
Hey guys, I'm a newbie here in google's geomap stuff.

I'm trying to combine/merge both examples you can find on the
documentation page :

http://code.google.com/intl/es-ES/apis/visualization/documentation/gallery/geomap.html

As you can see, there is a world map example with countries and
another one with US cities.

My idea is, if I have the world map, and click inside the Us, get into
the markers view and change the region to US.

But by know, I've been trying this and it's impossible.

I've tried adding some event listeners with 'regionClick' or
'zoomOut', but it didn't work.

Somethins like this :

var options = {};

google.visualization.events.addListener(
_this.geomap , 'regionClick', function(e) {
alert(e['region']);


});

If


Marcel Olmo

unread,
Jan 27, 2011, 12:44:24 PM1/27/11
to Google Visualization API
options['region'] = e['region'];
options['dataMode'] = 'markers';
});

.....

this.geomap.draw(data, options);


But I don't get what's happening.

Could somebody help me with these stuff ??

Many thanks in advance!!!!!

ChartMan

unread,
Jan 30, 2011, 4:15:38 AM1/30/11
to google-visua...@googlegroups.com
Is this resolved ?


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Carl Popolo

unread,
Apr 7, 2013, 2:40:41 PM4/7/13
to google-visua...@googlegroups.com
I could only get regionClick to work when displayMode is set to 'regions'.  When set to 'markers', the event isn't fired...  The geochart doc hints at this in the section on event listeners:  "This will not be thrown for the specific country assigned in the 'region' option (if a specific country was listed)."

Sergey Grabkovsky

unread,
Apr 8, 2013, 9:42:07 AM4/8/13
to google-visua...@googlegroups.com
In order for the regionClick even to be fired, the enableRegionInteractivity option must be set to true. In marker mode, it is set to false by default, so everything should work if you just set that option.

- Sergey


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages