O'Reilly logo

FusionCharts by Shamasis Bhattacharya, Pallav Nadhani, Sanket Nadhani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — writing the HTML and the JavaScript code to embed the map in a page

  1. Create a new file called FirstMap.html under the LearningFusionMaps folder.
  2. Write the following code in the page and save it:
    <html>
    <head>
    <title>My First Map</title>
    <script language="JavaScript" src="../FusionMaps/FusionMaps.js"></script>
    </head>
    <body>
    <div id="mapdiv" align="center">
    FusionMaps.
    </div>
    <script type="text/javascript">
    var map = new FusionMaps("../FusionMaps/FCMap_USA.swf", "Map1Id", "750", "400", "0", "0");
    map.setDataURL("Data.xml");
    map.render("mapdiv");
    </script>
    </body>
    </html>
    
  3. Open the HTML file in a browser to see your first map in action.

What just happened?

You just created your first map. The HTML code is very similar to what we have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required