Geomaps and Metropolitan Area Codes

1,092 views
Skip to first unread message

Ken Ficara

unread,
Apr 18, 2011, 9:08:31 PM4/18/11
to Google Visualization API
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 at
http://code.google.com/apis/visualization/documentation/gallery/geomap.html
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 to
http://code.google.com/apis/adwords/docs/appendix/metrocodes.html#New%20York

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);


}

rhickman.is.cre8tivecontrol.com

unread,
May 1, 2011, 2:54:37 PM5/1/11
to Google Visualization API
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 <k...@harmoni.ca> 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...

Joe Iz

unread,
Jul 24, 2019, 1:54:14 AM7/24/19
to Google Visualization API
The metropolitan codes appear to be not available in Google page, for those having issues to find DMA Metropolitan codes, you can refer to this article here http://superstorefinder.net/support/knowledgebase/how-to-get-metropolitan-codes-for-google-geochart-api/
Reply all
Reply to author
Forward
0 new messages