wmorris20

Access tags within setDataXML

Recommended Posts

Before switching to FusionMaps, I used an imagemap with an ajax call to dynamically call another page in a cluetip window with the specific location (marker) parameters. I'd like to continue with a similar setup; however, I'm having troubles accessing the XML tags within the setDataXML() method.

 

 

 

My attempts so far have been trying to assign a javascript function to the 'link' property of the marker.

 

 

 

Do you have any examples that may help me?

 

 

 

Thanks,

 

Ward

Share this post


Link to post
Share on other sites

I've been messing around with the Drill Down demo, but I've run into an issue with the string delimiter. Your demo uses an external xml sheet but I need to call setDataXML().

 

 

 

I get 'invalid XML data' for

 

 

 

link='JavaScript:myJS("356, blah");'

 

 

 

and

 

 

 

link="JavaScript:myJS('356, blah');"

 

 

 

I've also tried each scenario with the back slash delimiter without any luck.

Share this post


Link to post
Share on other sites

That won't work, because it looks something like this:

 

 

 

setDataXML("<marker id='001' link="j-myJS('blah', 356)" /&gt")

 

 

 

No matter which way I order the single and double quotes, there's a conflict with the setDataXML quotes.

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi,

Could you please send us the sample of the codes that you are using?

Awaiting your reply. :D

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Moris,

Thanks for your appreciation. :D

Could you please send us the XML codes that you are using as an attachment?

Awaiting your reply. :hehe:

Share this post


Link to post
Share on other sites

I was never able to successfully reference the internal IDs of the markers and use ajax cluetips; however, I wrote this script which simply shows/hides a div with a XMLHttpRequest call:

 

 

 

function map_popup(id, title, worktype, programphase) {

 

 

 

openPopup(true, "map_popup");

 

var element = document.getElementById('map_popup');

 

 

 

var http = new XMLHttpRequest();

 

var url = "./../requesthandler/request_handler.php";

 

var params = "title=" + title + "&id=" + id + "&worktype=" + worktype + "&programphase=" + programphase + "&requestType=info";

 

http.open("POST", url, true);

 

 

 

//Send the proper header information along with the request

 

http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

 

http.setRequestHeader("Content-length", params.length);

 

http.setRequestHeader("Connection", "close");

 

 

 

http.onreadystatechange = function() {//Call a function when the state changes.

 

if(http.readyState == 4 && http.status == 200) {

 

element.innerHTML = http.responseText;

 

}

 

}

 

http.send(params);

 

}

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