using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Text; // Using FusionMaps.dll using InfoSoftGlobal; public partial class FormBased_FormSubmit : System.Web.UI.Page { /// /// This program takes Maps Request value and convert into an Array /// Finally it converts the data into FusionMaps dataXML to render map /// protected void Page_Load(object sender, EventArgs e) { // Define dataArray Two dimension string Array element. 1st column take // map internal id and 2nd column take Value. string[,] dataArray = new string[8, 2]; // Array data assigned from Context object Items // In this example, we're directly showing this data back on Map. // In your apps, you can do the required processing and then show the // relevant data only. dataArray[0, 0] = "01"; dataArray[0, 1] = Context.Items["AS1"].ToString(); dataArray[1, 0] = "02"; dataArray[1, 1] = Context.Items["EU"].ToString(); dataArray[2, 0] = "03"; dataArray[2, 1] = Context.Items["AF"].ToString(); dataArray[3, 0] = "04"; dataArray[3, 1] = Context.Items["NA"].ToString(); dataArray[4, 0] = "05"; dataArray[4, 1] = Context.Items["SA"].ToString(); dataArray[5, 0] = "06"; dataArray[5, 1] = Context.Items["CA"].ToString(); dataArray[6, 0] = "07"; dataArray[6, 1] = Context.Items["OC"].ToString(); dataArray[7, 0] = "08"; dataArray[7, 1] = Context.Items["ME1"].ToString(); /* Now that we've the data in variables, we need to convert this into XML. The simplest method to convert data into XML is using string concatenation. */ StringBuilder strXML = new StringBuilder(); //Initialize element strXML.Append(""); // strXML.Append(""); strXML.Append(""); strXML.Append(""); strXML.Append(""); strXML.Append(""); strXML.Append(""); // Fetch Data from array for (int i = 0; i < dataArray.GetLength(0); i++) { // Set each map id and value strXML.AppendFormat("", dataArray[i, 0], dataArray[i, 1]); } // Close element strXML.Append(""); // Add Style on map strXML.Append("