[ka-Map-users] XMLOverlay Multiple Items at Same Point

Ghulam Muqtada muqtada at hotmail.com
Sat Oct 21 05:08:35 EDT 2006


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


More information about the ka-Map-users mailing list