help for gmap(Thomas Roca)

Create heatmaps using google geochart's api

Syntax

gmap [ varlist iso3 time_id] ]
using filename
[ , options ]

Description

gmap creates heatmaps for the web, using java api developped by google (see: https://developers.google.com/chart/interactive/docs/gallery/geochart/)

To be displayed, the webpage needs to find in its folder, 2 java scripts:
1. "jaspi" available at https://www.google.com/jsapi
2. "jquery-latest.js" available at: http://code.jquery.com/jquery-latest.js
NB. Make sure the using name is different from one map to another in the same folder if not the first page will be displayed instead of the freshly created.

The program will create a folder in the present working directory, containing: 1.the heatmap (HTML) and a copy of the two java files needed ("jsapi" & "jquery-latest.js" ) included in "gmap.zip"
Thus, all the content of "gmap.zip" must be unzipped in the ado directory. The program will copy the java files from the ado directory.
NB. This programme should work under unix or mac os, contact me otherwise.

The variable to map must be numeric. A country identifier variable must exist in the dataset; this variable must be named "iso3" and contains country ISO 3166-1 alpha-3 codes.
For more information about iso 3166-1 aplpha-3 codes, see: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3

options alternatives

zone(integer) 0=World| 1=Europe| 2=North America| 3=South America| 4=Africa| 5=Asia| 6=Asia Pacific| 7=Oceania| ->[default: World]
time(integer) Mandatory value of your j variable (year, etc.) ->[default: 2000]
color(integer) 1=Blue | 2=Green | 3=Purple | 4=Yellow ->[default: Blue]
color1_rgb(string) Custom color for minimum value: r,g,b ->[default: Blue]
color2_rgb(string) Custom color for maximum value: r,g,b ->[default: Blue]
width(integer) Width of the map, expressed in pixel ->[default: 850]
height(integer) Height of the map, expressed in pixel ->[default: 700]
title(string) Title of the map ->[default: "a stata command"]
legend(string) yes|no ->[default: no]

Examples

. gmap gdp iso3 year using map.html, time(2013)

. gmap myvar country_iso year using map.html, time(1990)

. gmap gdp country_iso year using map.html, time(1995) width(800) height(500)

. gmap gdp country_iso year using map.html, time(2000) zone(6) color(3)

. gmap gdp country_iso year using map.html, time(2000) color1_rgb(120,165,90) color2_rgb(210,120,169)

. gmap gdp country_iso year using map.html, time(2010) color(2) legend(yes) title(my map)

Acknowledgements

For more information on the underneath html and java code see: https://developers.google.com/chart/interactive/docs/gallery/geochart

Author

Thomas Roca,PhD, Research department, Agence Française de Développement(AFD), France.
Email:rocat@afd.fr