Metro Codes are not supported when dataMode is markers.

options['dataMode'] = 'region';

and the metro codes will work.

On Apr 18, 9:08 pm, Ken Ficara <[email protected]> wrote:
> Either I am missing something very basic, or the geomaps visualization
> does not, in fact, work with metropolitan area codes as is claimed in
> the documentation.
>
> I took the example code from the markers example 
> athttp://code.google.com/apis/visualization/documentation/gallery/geoma...
> and inserted it into the code playground. It worked as shown, using
> the names of the cities in the first column. But when I change the
> value in the first column to a metro code, the marker is not drawn.
>
> The code sample below draws all the markers except for the first, in
> which I have substituted "501" for "New York". 501 is the metropolitan
> area code for New York according 
> tohttp://code.google.com/apis/adwords/docs/appendix/metrocodes.html#New...
>
> Does anyone know how to use metropolitcan area codes with the geomap
> visualization?
>
> function drawVisualization() {
> var data = new google.visualization.DataTable();
> data.addRows(6);
> data.addColumn('string', 'City');
> data.addColumn('number', 'Popularity');
> data.setValue(0, 0, '501');
> data.setValue(0, 1, 200);
> data.setValue(1, 0, 'Boston');
> data.setValue(1, 1, 300);
> data.setValue(2, 0, 'Miami');
> data.setValue(2, 1, 400);
> data.setValue(3, 0, 'Chicago');
> data.setValue(3, 1, 500);
> data.setValue(4, 0, 'Los Angeles');
> data.setValue(4, 1, 600);
> data.setValue(5, 0, 'Houston');
> data.setValue(5, 1, 700);
>
> var options = {};
> options['region'] = 'us_metro';
> options['colors'] = [0xFF8747, 0xFFB581, 0xc06000]; //orange colors
> options['dataMode'] = 'markers';
>
> var container = document.getElementById('visualization');
> var geomap = new google.visualization.GeoMap(container);
> geomap.draw(data, options);
>
> }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
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.

Reply via email to