Hacking Google Maps and Google Earth (ExtremeTech)

(Dana P.) #1

Chapter 10 — Overlaying Statistical Data 193


}
addmarker(points[i].x,points[i].y,titles[i] + ‘: ‘ + popdata[i][year]);
}

for(var i=0;i<graphdata.length;i++) {
var pointpair = [];
pointpair.push(points[i]);
var volume = parseInt((parseFloat(graphdata[i])*100)/maxsize);
pointpair.push(new GPoint(points[i].x+increment,
points[i].y+increment));
var line = new GPolyline(pointpair,”#ff0000”,volume);
map.addOverlay(line);
polylines.push(line);
}
}


The circle example is available at http://maps.mcslp.com/examples/ch10-03.html.


The same population data shown in Figure 10-2 is shown here in Figure 10-4 as circles of
varying sizes. Again, you can see from the transparency of the graph data that it doesn’t matter
if multiple population data is overlaid on different parts of the map. Figure 10-5 shows
California again where the transparency of the overlaid data may be clearer.


FIGURE10-4: Using circles to demonstrate statistical data.

Free download pdf