<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><BR>hi Wayne,<BR>
Thanks for your replies and help you have provided me , Wayne I am not using Xml, and my PHP file doesn't return XML document , it simply return javascript code ,my earlier application had Xml involved, reason I of skipping XML document is I wanted so perform some Mouse Over and No click actions on POINT, so i used kaxmlPoint.setInnerHtml to add my own html code in POINT , I am wondering if i can do it using XML document,<BR>
and other thing is setInterVal needs a javascript function and interval time as argument, and I have to call my PHP file using some javscript function, xmlOverly.loadXml actually needs some XML document that I am generating rather i am generating JavaScript file that manually writes KxmPoints on Map, <BR>
<BR>
You are right about <BR>
var newScr = document.createElement("SCRIPT");<BR>newScr.src = "test.php?scale="+scale+"&lot_id="+lot_id;<BR>newScr.type="text/javascript";<BR>document.getElementsByTagName("head")[0].appendChild(newScr);<BR>
<BR>
it may keep my html expanding, I checked out in FireFox too, its working fine there but not showing Mouse Over function, is there any alternate of LoadXml, any thing that let application load JavaScript Or PHP file on the fly.<BR>
<BR>
Thanks a lot for your kind response<BR>
<BR>
<BR> Date: Sat, 21 Oct 2006 09:21:14 +1000<BR>> From: genii6@gmail.com<BR>> To: muqtada@hotmail.com<BR>> CC: ka-map-users@lists.maptools.org<BR>> Subject: Re: [ka-Map-users] XMLOverlay Multiple Items at Same Point<BR>> <BR>> Hi Ghulam,<BR>> Thanks for sharing your application with us. I think its another <BR>> innovative way of using kaMaps.<BR>> I noticed in your code that you are appending script elements to your <BR>> head tag within your HTML<BR>> document. I am not sure if this is a good idea as your html document <BR>> would simply keep expanding.<BR>> I confirmed this by using Firefox's view generated source feature. You <BR>> can confirm this yourself.<BR>> Just notice how the line keeps expanding just before the </head> tag.<BR>> <BR>> My advice is to leave out the "testLay(lot_id, scale)" function and at<BR>> <BR>> "this.myInterval=("testLay("+lot_id+","+scale+");",5000);<BR>> <BR>> replace it with:<BR>> <BR>> this.myInterval=('RNodesPosition.php?scale='+scale+'&<FONT face="">lot_id</FONT>='+lot_id);<BR>> <BR>> In this case, you would be invoking the php directly at every 5000ms <BR>> interval. Your php file would have to spit out XML<BR>> of course. Just curious, are you trying to avoid generating XML from the <BR>> php script? Comments and suggestions are welcomed.<BR>> <BR>> Cheers,<BR>> Wayne<BR>> <BR>> Ghulam Muqtada wrote:<BR>> > <BR>> > Hi Wei Yang, Ng<BR>> > <BR>> > I found solution for the problem i discussed earlier, this is the code <BR>> > that calls PHP file and PHP file in turn returns KaXmlPoint, , I have <BR>> > implemented mouse over on Points too<BR>> > <BR>> ><BR>> > function showMap()<BR>> > {<BR>> > <FONT face="">myXmlOverlay.remove</FONT>();<BR>> > if(this.myInterval !=0)<BR>> > {<BR>> > this.myInterval=clearInterval(this.myInterval);<BR>> > }<BR>> > startOverLay(<FONT face="">myKaMap.getCurrentScale</FONT>(),<FONT face="">myKaMap.getCurrentMap</FONT>().name);<BR>> > }<BR>> ><BR>> > function startOverLay(scale,lot_id)<BR>> > {<BR>> > myXmlOverlay = new kaXmlOverlay( myKaMap,250);<BR>> > this.myInterval=setInterval("testLay("+lot_id+","+scale+");",5000);<BR>> > }<BR>> > <BR>> ><BR>> > function testLay(lot_id,scale)<BR>> > {<BR>> > var newScr = document.createElement("SCRIPT");<BR>> > newScr.src = "RNodesPosition.<FONT face="">php?scale</FONT>="+scale+"&lot_id="+lot_id;<BR>> > newScr.type="text/javascript";<BR>> > document.getElementsByTagName("head")[0].appendChild(newScr);<BR>> > }<BR>> ><BR>> ><BR>> > this is the link<BR>> > <BR>> > http://202.163.115.116:8081/BrightLot/new/login.php<BR>> > <BR>> > username:user<BR>> > password:user<BR>> > <BR>> > Can I group KaXmlpoints and toggle them in legends area ,<BR>> > <BR>> > Thanks for replying<BR>> > <BR>> > <BR>> > <BR>> > <BR>> > <BR>> > <BR>> ><BR>> > <BR>> > ------------------------------------------------------------------------<BR>> ><BR>> > > Date: Thu, 19 Oct 2006 20:37:20 +1000<BR>> > > From: genii6@gmail.com<BR>> > > To: muqtada@hotmail.com<BR>> > > CC: ka-map-users@lists.maptools.org<BR>> > > Subject: Re: [ka-Map-users] XMLOverlay Multiple Items at Same Point<BR>> > ><BR>> > > Hi Ghulam,<BR>> > > Yes you are right. loadXml loads only XML and wouldnt be able to<BR>> > > interpret the output from the code u showed me.<BR>> > > You would want to write a php script that generates valid XML that <BR>> > would<BR>> > > create your overlay points.<BR>> > > So what happens is that setInterval will periodically call the <BR>> > loadXml()<BR>> > > function and the loadXml will read the output<BR>> > > from your php file. I would suggest testing out your php file first by<BR>> > > calling it directly from your browser to see that<BR>> > > the output is what you really want.<BR>> > ><BR>> > > Cheers,<BR>> > > Wayne<BR>> > ><BR>> > > Ghulam Muqtada wrote:<BR>> > > ><BR>> > > ><BR>> > > ><BR>> > > > Wayne, I am not constructing XML document that has tags like<BR>> > > > <overlay><BR>> > > > <point x="7435386.24" y="6172463.1" id="p1"><BR>> > > > <label>just a label</label><BR>> > > > <symbol shape="bullet" size="10" opacity="1" color="#FF0000" /><BR>> > > > </point><BR>> > > > </overlay><BR>> > > ><BR>> > > > but I am creating kaXmlPoints manualy and adding it to XmlOVerlay like<BR>> > > > var my_poin = myXmlOverlay.addNewPoint('p1',349,786);<BR>> > > > var my_label= new kaXmlLabel();<BR>> > > > var my_icon= new kaXmlIcon();<BR>> > > > my_label.text='Title One';<BR>> > > > my_label.boxcolor='#ff0000';<BR>> > > > my_label. h='10';<BR>> > > > my_label. w='50';<BR>> > > > my_label.font='Aria';<BR>> > > > my_label.color='#000000';<BR>> > > > my_icon.icon_w='20';<BR>> > > > my_icon.icon_h='41';<BR>> > > > my_icon.icon_src='images/bullet.gif';<BR>> > > > my_icon.draw(my_point);<BR>> > > > my_label.draw(my_point);<BR>> > > ><BR>> > > > above code works fine on index_overlay.html when i call it on some<BR>> > > > event, but i want to have this thing in setInterVal , above code is<BR>> > > > written in some seperate PHP file that generates it.<BR>> > > ><BR>> > > > What I guess is loadXml requires xml URL and my PHP file is not<BR>> > > > generating XML tags rather it creates kaXmlPoint directly.<BR>> > > ><BR>> > > ><BR>> > > > Regards<BR>> > > > Ghulam Muqtada<BR>> > > ><BR>> ><BR>> ><BR>> > ------------------------------------------------------------------------<BR>> > Express yourself with gadgets on Windows Live Spaces Try it! <BR>> > <http://discoverspaces.live.com?source=hmtag1&loc=us><BR>> <BR><BR><br /><hr />Get the new Windows Live Messenger! <a href='http://get.live.com/messenger/overview' target='_new'>Try it!</a></body>
</html>