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 previousRegion, previousResolution;
google.visualization.events.addListener(geochart, 'regionClick', function(
eventData) {
previousRegion = options.region;
previousResolution = options.resolution;
options['region'] = eventData.region;
options['resolution'] = 'provinces';
geochart.draw(data, options);
}
google.visualization.events.addListener(geochart, 'error', function () {
// back out one region
options.region = previousRegion;
options.resolution = previousResolution;
geochart.draw(data, options);
}
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?
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/MzcniN6gsjkJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.