|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/4/2008 7:46:37 PM
Posts: 8,
Visits: 13
|
|
Here is what I am trying to accomplish:
page loads with mapdiv in place, but no map object in existence.
'search' button is clicked. Search button (via javascript):
checks to see if map object currently exists (if(! getMapFromId("map1")));
if no map object exists, create one (value of the swf file to use is passed in to function at onClick of search button)
var map = new FusionMaps(swfPath,"map1","700","400","0", "1");
Ajax request executes to retrieve entity xml appropriate for the swf file chosen;
newly created map is updated and rendered via the Ajax call's 'onComplete' handler
var mapobj = getMapFromId("map1");
mapobj.setDataXML(ajaxrequest.responseText);
mapobj.render("mapdiv");
Why would this not work? What is wrong with this approach/logic? The symptoms are:
ver mapobj = getMapFromId("map1") is undefined. It's as though it does not exist.
How can I reinitialize my map object client side whenever a different map is selected, no frames, no iframes, all within a single page? Any assistance and input you can provide is much appreciated. Most helpful would be a very very simple example of Javascript that does something similar to what I'm describing. I have looked through online examples, documentation, googled it....
Thank you. Shukriya.
Doug :0)
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Today @ 5:38:52 AM
Posts: 884,
Visits: 1,420
|
|
| hi, The first concept/logic is what we also used in one of the simplest AJAX sample for FusionCharts and posted up here :http://www.fusioncharts.com/forum/FindPost2797.aspx You can easily use this in your FusionMaps code too. You can reinitialize your map at client side using the the same JS functions that you use for first initialization.
Regards,
Sudipto Choudhury FusionCharts Team
|
|
|
|