[ka-Map-users] kaXmlOverlay and ONMOUSEOVER()

Sige sigenz at yahoo.co.nz
Wed Apr 26 23:44:09 EDT 2006


Hi,

That is nice. just wonder if it is possible to define
additional attributes for the kaXmlPoint class to be
displayed on the popup, and how to do it.

Cheers

Sige

----- Original Message ----- 
From: Sepehr Sadeghi 
To: Brent Pedersen 
Cc: ka-map-users at lists.maptools.org 
Sent: Saturday, March 04, 2006 10:47 AM
Subject: Re: [ka-Map-users] kaXmlOverlay and
ONMOUSEOVER()


Works great now!!

Here is the code in case anyone else would like to use
it:
In file kaXmlOverlay.js around line 962, inside the
function ;
kaXmlPoint(pid, xml_overlay) {

//add these lines
this.div.onmouseover=function(){ overlib('This is the
message', STICKY, CAPTION, 'Info' )};
 this.div.onmouseout=function(){ nd() };
}
 
/****************************************************/
I downloaded the overLib mouseover library from;
https://sourceforge.net/project/showfiles.php?group_id=6218&package_id=6280&release_id=339422

(its a few .js files, so I put them in a folder called
overlib)

Inside the index.html, I added:
<script type="text/javascript"
src="overlib/overlib.js"></script>

Right after my <body> tag in index.html I added:
<div id="overDiv" style="position:absolute;
visibility:hidden; z-index:1000;"></div>
(I am not sure how necessary it is).


overLib has many more options, which you can read
about at: 
http://www.bosrup.com/web/overlib/



I have not tested this with the XML file, (have not
gotten that working yet), but it *should* work, since
it creates kaXmlPoint's as well.

-sepehr





On 3/3/06, Brent Pedersen <bpederse at gmail.com> wrote: 
hi, glad it worked. 

you're missing a closing } for your onmouseover.



On 3/3/06, Sepehr Sadeghi <sadegs at alum.rpi.edu >
wrote: 
Brent, 
thanks for the help... the this.div.onmouseover =
function(){ alert(pd) } ; worked as planned.
Unfortuneately, I can not get the callout box to
work...I am using overLib.js, have already defined it
in a tag in index.html ;
<script type="text/javascript"
src="overlib/overlib.js"></script>

here is the code for the kaXmlPoint, at the bottom is
the onmouseover event attachment;

function kaXmlPoint(pid, xml_overlay) {

 this.xml_overlay = xml_overlay;
 this.pid = pid;
 this.divId = this.xml_overlay.getDivId (pid);
 this.geox = 0;
 this.geoy = 0;
 this.shown = false;
 
 this.graphics = new Array(); 
 
 this.div = document.createElement('div');
 this.div.setAttribute('id', this.divId);
 //this.div.onmouseover =  function(){ alert(pd) };
 this.div.onmouseover=function(){ overlib('This is an
ordinary popup.'); 
 this.div.onmouseout=function(){ nd() };
}
 
Thanks
-Sepehr
 
On 3/3/06, Brent Pedersen <bpederse at gmail.com > wrote:

hi, not sure about the workings of kaXML, but you
probably need 
this.onmouseover = function(){ alert(pid) }
or  maybe 
this.div.onmouseover = ...
-brent


On 3/3/06, Sepehr Sadeghi < sadegs at alum.rpi.edu>
wrote:
Hello All,
I am trying to implement a way that when you mouseover
a kaXmlPoint, it will display a "tooltip" or
"callout". 
Typically you could could add a ONMOUSEOVER() in the
html image tag, but since this is a javascript object
its not straightforward. 

I tried adding a 
 this.onmouseover(alert(pid));
inside the function kaXmlPoint(pid, xml_overlay) {    
 in the kaXmlOverlay.js file. That didn't work as
expected!

Does anyone have any suggestions?

The other ways I was thinking of handling it was;
 - on MOUSEMOVE() , compare mouse coords to each
point's coords (not efficient)
 - create a new event handler (KA_POINT_OVER); (not
sure how that would work)


Thanks
-Sepehr

-- 



..:: Sepehr Sadeghi          ::..
..:: sadegs at alum.rpi.edu  ::..
 

_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org 
http://lists.maptools.org/mailman/listinfo/ka-map-users





 




-- 



..:: Sepehr Sadeghi          ::..
..:: sadegs at alum.rpi.edu   ::..
..:: 603-205-4402              ::.. 





-- 



..:: Sepehr Sadeghi          ::..
..:: sadegs at alum.rpi.edu  ::..
..:: 603-205-4402              ::.. 


--------------------------------------------------------------------------------


_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ka-map-users


Send instant messages to your online friends
http://au.messenger.yahoo.com 

Send instant messages to your online friends http://au.messenger.yahoo.com 


More information about the ka-Map-users mailing list