Deprecated
Google has now stopped its Earth API and Maps API is a paid for API nowadays. Some capabilities have also been either removed or changed. Therefore, I had to remove all examples of VizMap applications I had created. I didn’t remove the entire topic as I thought some of the code may still be useful with some modifications.
Overlaying shapes on markers
Try it out first ?
since this is just an enhancement of that.
How to specify circle sizes and colors
As in the other mapping examples, javaScript procedures are created based on the Excel data, which are then executed to create a map. Adding circles is simply building on what has been already covered in
Adding markers to Google Maps from Excel.
Here is an example
In the VenueMaster tab of the googleMapping.xlsm workbook, you will see two columns – markerColor and markerSize. These are used to provide the data needed to plot the circles. You can use whatever mechanism you want to create the relative size data.
Specifying the color
The color is specified as standard html color code. This is similar, but not the same as, RGB codes. See VBA rgb to htmlRGB for how to convert. Quite often using a color ramp – see Charts and color ramps, is an effective method of choosing overlay colors. You can use the Color ramp library to do this, and it can be entered as an Excel formula. In the example above, the markerColor column has this formula – with the color being calculated according to its position relative to the maximum and minimum size.
|
=rgbToHTMLHex(rampLibraryRGB("heatmap",MIN($F$2:$F$8),MAX($F$2:$F$8),F2)) |
Activating circles
The module for generating this map is exactly the same as in
Adding markers to Google Maps from Excel, but in the geoCoding Parameters Sheet we have introduced this, where the color and size parameter are given the names of the columns that hold the values to use in order to plot the circle.

Changing the properties of the circle
By default, the circle properties are
|
if (sz) { var circle = { strokeColor: color, strokeOpacity: 0.8, strokeWeight: 1, fillColor: color, fillOpacity: 0.20, map: gMap, center: p, radius: pa |
Changing these is just a matter of editing the above, which is in the functions row of the marker html parameter block in the geoCodingParamers worksheet. For advice on calculating sizes, see
the size of circles on Google Maps.
Using squares instead of circle overlays
You can use a square instead of a circle by changing a parameter on the geocoding parameters sheet. Just change the shape parameter to ‘square’
The radius for the circle is used as a 45 degree half diagonal for the square, so the apparent coverage would look the same as an equivalent sized circle. The same properties are applied here as for the circles and the colors you select on your sheet are passed through.
Using alternative Markers
You can also specify alternative markers. In the same Markers parameter block, just specify an alterative image to use in the column that corresponds to the markerImage parameter.