Advanced Troubleshooting |
In this section, we explore some of the common issues faced by users. |
Why are the JavaScript maps not working when running from local file system? Same code works fine in server. |
You seem to be using the Data URL method (provide data to map from files or streams) to provide map data. Many browsers restrict JavaScript from accessing local file system owing to security reasons. The JavaScript maps, when running locally, will not be able to access data provided as a URL. If you run the files from a server, it will run absolutely fine, as the data is then read and streamed by the server, without the need for JavaScript to directly access local file system. When running locally, however, if you provide the data as string (using the Data String method), it works fine. |
How to enable JavaScript Debug mode? |
To enable the JavaScript Debug Mode, you need to write the following lines of code FusionCharts.debugMode.enabled(true); Also, you need to specify where you will like to display the "debugMode" output. In case you want to see the error within the browser’s JavaScript console, you need to write the following lines of code: FusionCharts.debugMode.outputTo( function() { console.log(arguments); } ); Please note that, depending upon your browser, you may need to specifically enable "JavaScript Console". For further details on the above, please refer to Debugging your maps > Using JavaScript page. |
I cannot understand the error codes which are shown when my map fails. How do I comprehend them? |
For your reference, we have created a table with all the errors and description of each. Please refer to the table from FusionMaps XT and JavaScript > Handling errors page. |
Maps are rendering fine in Windows, but when I copy the same folder to my Linux or Mac server, they stop working |
You need to check whether the files names which you are referring in the code using proper cases. Please note that, in Windows file names are not case-sensitive. But, in Mac or Linux, file names are case-sensitive. Hence, if the actual file name is FCMap_World.swf, you cannot use fcmap_world.swf in your code. Although, this will work in Windows, but will fail in Mac or Linux. |
Maps stop rendering if I set the height in percentage |
When you set percent size to a map, it tries to get the width/height of its parent container. It seems that the container where you are rendering the map is not set with a proper height when the map is rendered into it. For example, if you have a container <div id="mapContainer"> and this DIV is not set with an absolute or relative height, the DIV's height will be zero. When a map is rendered in this DIV with 100% height, the map will try to derive the height of the parent DIV which is zero. The map will render zero pixel as height. Please try once setting absolute height to the map or the constrainer element and check. An example is give below: <div id="mapContainer" style="width:100%; height:800px;">FusionMaps XT will load here!</div> <script type="text/javascript"> var map = new FusionCharts("FCMap-World.swf", "MapId", "100%", "100%", "0" ); map.setXMLUrl("Data.xml"); map.render("mapdiv"); </script> |
The map cannot load JSON from URL although the path to the JSON file is correct. |
Many web servers like IIS6, do not serve .json (no wildcard MIME type) files by default. You need to setup your web server to server json files. In IIS6 you can do this using these steps:
|
JavaScript links are not working although I have set the correct value e.g., link='JavaScript:alert(1234);' The links however, works when I run the code from my server |
Due to Flash Player security implementation, links from maps will not work if you run the map from local file system. To make the links work, as well make all the map API's work, you need to configure Flash Player Global Security Settings. We have discussed more on how to configure this in the next topic. |
How do I configure Flash Player Global Security Settings? |
Flash Player's Global Security implementation blocks JavaScript to interact with maps (Flash maps) when you are running the web page/application with maps from local file system. To configure Flash Player Global Security Settings (to enable links and map APIs) and enable JavaScript calls from maps, you need to add the folder containing the map SWF files to Flash Player's Trusted Zone. Please refer to How to Setup Flash Player Global Security Settings page for a detailed step-by-step guide. |
JavaScript map shows 'Invalid Data' even though the Flash maps work fine with the same data. Why? |
Please make sure that there are no duplicate attributes, invalid XML entities or extra quotes (") mentioned in the XML of the map. Although, the Flash maps ignore duplicate attributes, the JavaScript maps apply a strict XML validation. In case the issue still persists please enable the "debugMode" of the map in the HTML page and check with the XML invoked. |
maps work fine if my HTML and all SWF and JavaScript files are in the same folder. But, fails if they are segregated to separate folders. |
You need to keep the points stated below:
|
Why is the word "Map" displayed instead of the map? |
Any of these listed reasons can cause this error to occur:
|
Why do the JavaScript maps show "Retrieving data.." if I run them locally while the Flash maps renders fine? |
JavaScript maps use AJAX to load data from the URL data sources. Some browsers do not allow AJAX data loading to function when running from local file system (using file:/// protocol). Hence, when you run the JavaScript maps from local file system and you are using the Data URL method (setXMLUrl, setJSONUrl or similar functions) to provide data to maps where physical xml or json files are involved, this error occurs. To over-come this situation you need to render the JavaScript maps using Data String method. |
Maps do not work in my Flex Applications |
FusionMaps XT or lower does not work directly in Flex (AS3) based applications. To use FusionCharts in Flex (AS3) based applications, you need to use FusionCharts for Flex. FusionMaps XT (core) had been coded in ActionScript 2 (Flash 8 - AVM1). We haven't ported them to ActionScript 3 (AVM2); instead, we have modified the existing FusionMaps XT SWF files - so that, they can load efficiently in your Flex solutions and then be controlled by your Flex code. As such, you need not bother about cross AVM issues. All that is to be done is to load the FusionCharts specialized SWF and SWC files, provide the data, and control it from your Flex project. For further details, please refer to FusionCharts for Flex Documentation. |
Why does the "Waiting" button never become "Save" button while exporting my map? |
Please make sure you have done the following while exporting a map to avoid the situation:
|
I cannot remove the 'Save as PDF' option from the right-click menu. Please help. |
If you wish to remove all "Save as..." options from the right-click menu, please try setting the attribute exportShowMenuItem to 0 in the <map> element. If you wish disable only the "Save as PDF" option, you can define exportFormats="JPG|PNG" in the <map> element. Using similar method, you can disable any of the other options. |
I cannot display multi-lingual or accented characters in map, although in the XML I have declared <?xml version="1.0" encoding="utf-8"?> in the XML |
Please note that in order to use any multi-lingual characters on the map, you necessarily need to use UTF-8 encoded XML/JSON. More importantly, the XML/JSON file or stream requires UTF-8 BOM stamp to be present as the very first 3 Bytes of the file. Most of the text editors like Notepad can do this automatically. To know more on how to BOM mark a file, please read Using Multi-lingual text page in Advanced Topics > Using special characters section. Please note the two basic thumb rules:
BOM is Byte Order Mark. It is 'EF BB EF' - these 3 bytes in case of UTF-8 encoded files, the BOM being placed at the very beginning of the file. It is an indicator that the file contains UTF-8 encoded strings. Also, please note that specifying the encoding setting i.e., <?xml version="1.0" encoding="UTF-8"?> in the XML header region does not add the Byte Order Mark (BOM) to the XML/JSON file. However, please note that FusionMaps XT supports only left-to-right languages, as of now. It doesn't have native support for right-to-left languages like Hebrew. So, if you want to use Hebrew with FusionMaps XT, you'll have to programmatically reverse the sequence of words/characters and then provide the same to FusionCharts. |
When I pass multi-lingual or accented characters to JavaScript functions from link, they get broken. Do you have a fix for this? |
Please try setting unescapeLinks='0' in the <map> element in order to pass the multi-lingual or accented characters to JavaScript functions from links perfectly from a map. |
I want to generate the map automatically at server at a given interval and keep sending email containing the latest maps. Please help. |
Please note that FusionMaps XT does not support mailing of maps directly, as of now. But since FusionMaps XT allows exporting to image and saving on server, you can write your own script to automatically email the saved image. Also, if you are willing to export the maps directly as images (JPG/JPEG/PNG/PDF directly) without rendering it in the browser, please note that our developers have created a .NET based server-side Image Saver Assembly that allows exporting maps as images without rendering it in the browser. Please note that this works only using .Net framework of Windows. This is an internal implementation, which is not included and/or associated with the FusionMaps XT pack. For receiving the same, drop us a mail requesting for this assembly at support[@]fusioncharts.com. |
I cannot change map message after a map has been rendered? |
As of now, you cannot directly set a message to an already rendered map. However, as work-around, you can use a private JavaScript function to change the map message after the map has been rendered. The syntax to use this function is : FusionCharts("mapDOMId").ref.showChartMessage("your message as string"); An example can be : FusionCharts("myMapId").ref.showChartMessage("message"); Please note that this function will remove any existing map from the canvas before showing the message. |