Sign in to follow this  
beso

Question About Fusionmaps

Recommended Posts

Hello I am a novice user, I work on the ASP.net program and use MS sql server for database. And I would like to use FusionMaps to view the data from database as statistics on map

I've downloaded the FusionMaps program but I'm not sure from installation

 

I did all the steps listed here

"Installation of FusionMaps for your web application is just a two-step affair:

 

  1. Create a folder named FusionMaps in the root of your application (though, it's not mandatory to name the folder as FusionMaps or create it under root folder. However, it organizes things a lot more, as all the pages within your website can now access the common set of maps).
  2. Copy all the SWF files from Download Package > Maps Folder and paste it in this folder.

I did not know how i use it within ASP.net

 

i want to know how i can use it with these programs?

 

I hope that this is the right place to put this topic

and I hope that the response to my question as soon as :unsure:

Thank you

Edited by beso

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

 

FusionMaps works with all databases including MS SQL, Oracle, MySQL, PostgreSQL, CSV or even legacy data storage.

 

Creating a map using dynamic data from database involves following steps:

 

1. Initiate database connection in your server side script.

 

2. Retrieve the data from database that you wish to show on the map.

 

3. Generate map data (XML) by iterating through each record. This can be either done using simple String concatenation or, using XML objects if your server-side scripts support the same.

 

4. Provide the map data to the map as string/URL. No need to save/store them on server as physical files; you can virtually relay them.

 

For more details, please visit the link : http://www.fusioncharts.com/maps/docs/Contents/CodeASPCSDB_USMap.html

 

Hope this helps.

Share this post


Link to post
Share on other sites

Thank you for your response<BR closure_uid_dzhn99="611" Tc="null">But I have other question Can I use other language than English for writing on the map such as Arabic language :mellow:

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

FusionMaps allows you to use multi-lingual (UTF-8) characters on the charts.

 

To use multi-lingual characters on the map, you necessarily need to use UTF-8 encoded XML. More importantly, the XML file/stream does require a BOM stamp to be present as the very first 3 Bytes of the file. Hence, one must remember the two basic thumb rules :

 

for dataURL method - the XML file/stream should be having the BOM stamp and

 

for dataXML method - the HTML/application file containing the XML as well as the map SWF should have the BOM stamp.

 

Please find the sample zip file attatched for your reference.

 

More details at :http://www.fusioncha...ars/SpChar.html

 

Hope this helps.

WorldMapInChineseText_Sample.zip

Share this post


Link to post
Share on other sites

Hello again

I have faced another problem during executing the program in asp.net VB

When I press debug does not appear anything in the browser

While I used

Adobe Flash Player

with version 11,1,102,55 installed

I have tried more than a browser (internet explorer, chrome, and firefox)

And I do not know where is the problem :mellow:

Edited by beso

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

Could you please send us a scaled down sample to look into the issue?

 

Awaiting for your response.

Share this post


Link to post
Share on other sites

Hello again

Thank you for your response with me

I am a new user in the world of fusion chart

For this reason, I find it difficult to solve my problems

I hope to help me in solving it

I try to view the map of Saudi Arabia in all regions

I want to write the number of patients in each region on the toolText

after i retrieve it from sql bata base

 

But I get this error in execution "Invalid XML data"

This is the code I used in ksa.aspx.vb form

Imports InfoSoftGlobal

 

Imports System.Data.SqlClient

 

Partial Class ksa

 

Inherits System.Web.UI.Page

 

Dim str_connection As String = "Data Source=SONY-VAIO\SQLDB;Initial Catalog=kellanaDB;Integrated Security=True"

 

'Initial Catalog=FinAccounting"

 

'Declare and build a query string

 

Dim str_sql_user_select As String = "SELECT patient_ID FROM patient where city='الرياض'"

 

Dim mycon As SqlConnection

 

Dim comUserSelect As SqlCommand

 

'Declaring the DataReader object

 

Dim myreader As SqlDataReader

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

'Instantiate the connection object

 

mycon = New SqlConnection(str_connection)

 

'Instantiate the command object

 

comUserSelect = New SqlCommand(str_sql_user_select, mycon)

 

'Opening a Connection with the Open() method

 

mycon.Open()

 

'Creating a DataReader object by using

 

'the ExecuteReader() method of the Command object.

 

myreader = comUserSelect.ExecuteReader

 

Dim n As Integer

 

n = 0

 

While myreader.Read = True

 

n = n + 1

 

End While

 

 

 

'Now, we need to convert this data into XML.

 

'We convert using string concatenation.

 

'Declare strXML to store dataXML of the map

 

Dim strXML As New StringBuilder

 

'Initialize <map> element

 

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

 

strXML.Append("<colorRange>")

 

strXML.Append("<color minValue='1' maxValue='2' displayValue='السعودية العربية المملكة' color='069F06' />")

 

strXML.Append("</colorRange>")

 

'Open data element that will store map data

 

strXML.Append("<data>")

 

'Set each map <entity> id and value for 23 regions in ksa

 

strXML.Append("<entity id= 'SA.RI'" & "' toolText='" & n & " is number of patient" & "' />")

 

 

 

strXML.Append("<entity id= 'SA.HS'" & "' toolText='" & m & " is number of patient" & "' />")

 

 

 'and so on for all regions

 

strXML.Append("</entity>")

 

Next

 

'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 FusionCharts class of InfoSoftGlobal namespace (FusionMaps.dll in BIN folder)

 

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

 

Dim mapHTML As String = FusionMaps.RenderMap("FusionMap/Map/FCMap_SaudiArabia.swf", "", strXML.ToString(), "mapid", "600", "400", False, False)

 

'embed the chart rendered as HTML into Literal - WorldPopulationMap

 

kSAMap.Text = mapHTML 

 

End Sub

 

End Class

 

 

 

and this code in ksa.aspx

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ksa.aspx.vb" Inherits="ksa" %>

 

<!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>FusionMaps v3 - Database Example</title>

 

<script src="FusionMap/JSClass/FusionMaps.js" type="text/javascript"></script>

 

</head>

 

<body>

 

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

 

<% 'Show kSA Map' %>

 

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

 

</form>

 

</body>

 

</html>

 

Please help me to solve this problem

Edited by beso

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

Could you please send us the generated XML code to look into the issue?

 

The XML code can be found from the browser view-source menu.

 

Awaiting for your response.

Share this post


Link to post
Share on other sites

<!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>

<title> FusionMaps v3 - Database Example</title>

<script src="FusionMap/JSClass/FusionMaps.js" type="text/javascript"></script>

</head>

<body>

<form method="post" action="ksa.aspx" id="form1"><div class="aspNetHidden">

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTYyNzcxNDY4Ng9kFgICAw9kFgJmDxYCHgRUZXh0BbYFPCEtLSBTVEFSVCBTY3JpcHQgQmxvY2sgZm9yIE1hcCBtYXBpZCAtLT4NCjxkaXYgaWQ9J21hcGlkRGl2JyA+DQpNYXAuDQo8L2Rpdj4NCjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4NCnZhciBNYXBfbWFwaWQgPSBuZXcgRnVzaW9uTWFwcygiRnVzaW9uTWFwL01hcC9GQ01hcF9TYXVkaUFyYWJpYS5zd2YiLCAibWFwaWQiLCAiNjAwIiwgIjQwMCIsICIwIiwgIjAiKTsNCk1hcF9tYXBpZC5zZXREYXRhWE1MKCI8bWFwIHNob3dMYWJlbHM9JzEnIGluY2x1ZGVOYW1lSW5MYWJlbHM9JzEnIGRpc3BsYXlWYWx1ZT0nUG9wdWxhdGlvbicgYm9yZGVyQ29sb3I9JzAwMDAwMCcgZmlsbEFscGhhPSc4MCcgc2hvd0JldmVsPScwJyBsZWdlbmRQb3NpdGlvbj0nQm90dG9tJyA+PGNvbG9yUmFuZ2U+PGNvbG9yIG1pblZhbHVlPScxJyBtYXhWYWx1ZT0nMicgZGlzcGxheVZhbHVlPSfYp9mE2LPYudmI2K/ZitipINin2YTYudix2KjZitipINin2YTZhdmF2YTZg9ipJyBjb2xvcj0nMDY5RjA2JyAvPjwvY29sb3JSYW5nZT48ZGF0YT48ZW50aXR5IGlkPSAnU0EuUkknJyB0b29sVGV4dD0nMSBpcyBudW1iZXIgb2YgcGF0aWVudCcgLz48L2VudGl0eT48L2RhdGE+PC9tYXA+Iik7DQpNYXBfbWFwaWQucmVuZGVyKCJtYXBpZERpdiIpOw0KPC9zY3JpcHQ+DQo8IS0tIEVORCBTY3JpcHQgQmxvY2sgZm9yIE1hcCBtYXBpZCAtLT4NCmRkO+HD0lpSq4FWFMLwxEM6auUpyLqWwDzvBuen5ofO+fk=" /></div>

<!-- START Script Block for Map mapid -->

<div id='mapidDiv' >Map.</div>

<script type="text/javascript">var Map_mapid = new FusionMaps("FusionMap/Map/FCMap_SaudiArabia.swf", "mapid", "600", "400", "0", "0");Map_mapid.setDataXML("<map showLabels='1' includeNameInLabels='1' displayValue='Population' borderColor='000000' fillAlpha='80' showBevel='0' legendPosition='Bottom' >

<colorRange><color minValue='1' maxValue='2' displayValue='السعودية العربية المملكة' color='069F06' />

</colorRange>

<data>

<entity id= 'SA.RI'' toolText='1 is number of patient' /></entity>

</data>

</map>");Map_mapid.render("mapidDiv");

</script>

<!-- END Script Block for Map mapid -->

</form>

</body>

</html>

 

:unsure:

Edited by beso

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