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

Sepehr Sadeghi sadegs at alum.rpi.edu
Fri Mar 3 17:47:48 EST 2006


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              ::..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060303/bb5685a5/attachment.html


More information about the ka-Map-users mailing list