Time for action — drilling down from the US map to the individual states
1. Create a folder called
DrillDown
underLearningFusionMaps
, where we will store the HTML and XML files for both the parent US map and the 10 state maps it drills down to.2. Make a copy of
FirstMap.html
andData.xml
under theDrillDown
folder, and rename them asDrillDown.html
andDrillDown.xml
respectively.3. Update the relative path of the FusionMaps JavaScript class and the US map in
DrillDown.html
using the following lines of code:<script language="JavaScript" src="../../FusionMaps/FusionMaps.js"></script> var map = new FusionMaps("../../FusionMaps/FCMap_USA.swf", "Map1Id", "750", "400", "0", "1");
4. Change the URL of the XML file in
DrillDown.html
to the new file as well, using the following line of code:map.setDataURL("DrillDown.xml");
5. Create an XML file
Alabama.xml
in theDrillDown
folder with the following data:<map fillColor='F1F1F1' numberPrefix='$'> <colorRange> <color minValue...