Re: Check if region map is avaible in GeoChart

570 views
Skip to first unread message

asgallant

unread,
Aug 28, 2012, 2:54:27 AM8/28/12
to google-visua...@googlegroups.com
I don't know if there is any way to determine what regions are available.  You can set up an "error" event handler, and use it to back out to the previous region:

var previousRegionpreviousResolution;
google.visualization.events.addListener(geochart'regionClick'function(eventData{
    previousRegion options.region;
    previousResolution options.resolution;
    options['region'eventData.region;
    options['resolution''provinces'
    geochart.draw(dataoptions);
}
google.visualization.events.addListener(geochart'error'function ({
    // back out one region
    options.region previousRegion;
    options.resolution previousResolution
    geochart.draw(dataoptions);
}

On Monday, August 27, 2012 11:08:50 PM UTC-4, Rômulo Vitoi wrote:
I have a map set to region = world, and this event to zoom in:
google.visualization.events.addListener(geochart, 'regionClick', function(eventData) {
    options['region'] = eventData.region;
    options['resolution'] = 'provinces'; 
    geochart.draw(data, options);
}

When I click on US then US-TX it works, but when I click on BR then BR-RJ it gives me this error: Requested map does not exist. 

Is there a way to check if the region map is avaible so I can avoid this error?

Rômulo Vitoi

unread,
Aug 28, 2012, 1:30:21 PM8/28/12
to google-visua...@googlegroups.com
That solves my problem, thanks!
Reply all
Reply to author
Forward
0 new messages