Sign in to follow this  
Mark01

Cannot Run Fusion Maps Basic Example

Recommended Posts

Hi all,

I've just downloaded fusion maps trial version and try to run applicatin in ASP.NET but when I start it nothing happens. This is a code:

 

string[,] dataArray = new string[8, 2];

 

dataArray[0, 0] = "01";

 

dataArray[0, 1] = "3779000000";

 

dataArray[1, 0] = "02";

 

dataArray[1, 1] = "727000000";

 

dataArray[2, 0] = "03";

 

dataArray[2, 1] = "877500000";

 

dataArray[3, 0] = "04";

 

dataArray[3, 1] = "421500000";

 

dataArray[4, 0] = "05";

 

dataArray[4, 1] = "379500000";

 

dataArray[5, 0] = "06";

 

dataArray[5, 1] = "80200000";

 

dataArray[6, 0] = "07";

 

dataArray[6, 1] = "32000000";

 

dataArray[7, 0] = "08";

 

dataArray[7, 1] = "179000000";

 

StringBuilder strXML = new StringBuilder();

 

//Initialize <map> element

 

strXML.Append("<map showLabels='1' includeNameInLabels='1' borderColor='FFFFFF' fillAlpha='80' showBevel='0' legendPosition='Bottom' >");

 

// Set Color ranges : 4 color ranges for population ranges

 

strXML.Append("<colorRange>");

 

strXML.Append("<color minValue='0' maxValue='100000000' displayValue='Population : Below 100 M' color='CC0001' />");

 

strXML.Append("<color minValue='100000000' maxValue='500000000' displayValue='Population :100 - 500 M' color='DDD33A' />");

 

strXML.Append("<color minValue='500000000' maxValue='1000000000' displayValue='Population :500 - 1000 M' color='069F06' />");

 

strXML.Append("<color minValue='1000000000' maxValue='5000000000' displayValue='Population : Above 1000 M' color='ABF456' />");

 

strXML.Append("</colorRange>");

 

// Open data element that will store map data

 

strXML.Append("<data>");

 

// Use Data from array for each entity

 

for (int i = 0; i < dataArray.GetLength(0); i++)

 

{

 

// Set each map <entity> id and value

 

strXML.AppendFormat("<entity id='{0}' value='{1}' />", dataArray[i, 0], dataArray[i, 1]);

 

}

 

// close data element

 

strXML.Append("</data>");

 

//close map element

 

strXML.Append("</map>");

 

 

 

// Create the Map with data contained in strXML

 

// and Return HTML output that embeds the Map

 

// We use FusionMaps class of InfoSoftGlobal namespace (FusionMaps.dll in BIN folder)

 

// RenderMap() generates the necessary HTML needed to render the map

 

string mapHTML = FusionMaps.RenderMap("~/FusionMaps/FCMap_World8.swf", "", strXML.ToString(), "mapid", "600", "400", false, false);

 

//embed the chart rendered as HTML into Literal - WorldPopulationMap

 

WorldPopulationMap.Text = mapHTML;

 

 

Do I need to add something else.

Thanks for your help.

 

 

Share this post


Link to post
Share on other sites

Thanks for reply but I've included that dll. When I run it IE just stucks it tries to load page but progress bar doesn't get to the end. This is code for page.

 

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SimpleExample._Default" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml" >

 

<head runat="server">

 

<title></title>

 

<script language="javascript" src="FusionMaps.js"></script>

 

</head>

 

<body>

 

<form id='form1' name='form1' method='post' runat="server">

 

 

<% //Generate World Map in the Literal Control WorldPopulationMap%>

 

<asp:Literal ID="WorldPopulationMap" runat="server" />

 

</form>

 

</body>

 

</html>

 

 

 

 

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

Thanks for your response.

When viewing your page containing the map, if you see an endless loading progress bar in your browser, or if the right click menu (right click at the place where the map is supposed to be) shows "Movie not loaded", please check the following:

1, Please check if the SWF path is properly provided in your HTML page is correct. Also, check if the SWF file actually exists there.

2. If you're working on a case-sensitive file system Operating System, check for the case of path and SWF file.

3. Please check if you've Adobe Flash Player 8 (or above) installed on your machine.

4.Please check whether you've enabled your browser to show ActiveX controls. Normally, all browsers are Flash-enabled.

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this