[ka-Map-users] RE: ka-Map-users Digest, Vol 11, Issue 7
Base Bloc
chris at basebloc.com
Sat Mar 4 02:50:12 EST 2006
Hi Sepehr,
The mouseover call need to be placed in the DOM, place the following code at
the end of the myMapInitialized function in startUp.js:
function alertit(){
alert("You moved your mouse over me!")
}
myCanvas = myKaMap.createDrawingCanvas( 5000 );
var marker = document.createElement( 'img' );
marker.src = 'images/kamap.gif';
var bname = navigator.appName;
if (bname == "Microsoft Internet Explorer")
{
marker.attachEvent("onmouseover",alertit)
}
else
{
marker.addEventListener("mouseover",alertit,false)
}
myKaMap.addObjectGeo( myCanvas, 493183, 1278465, marker );
There is a good tutorial on mouse events in the DOM at
http://www.javascriptkit.com/dhtmltutors/domevent1.shtml
Chris
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christopher Brown
Head of Internet Development
Base Bloc Cambodia
#33, 123, Phnom Penh, Cambodia.
P.O. Box 2086
www.basebloc.com
Tel (+885) 12 315 302
-----Original Message-----
From: ka-map-users-bounces at lists.maptools.org
[mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of
ka-map-users-request at lists.maptools.org
Sent: 04 March 2006 00:06
To: ka-map-users at lists.maptools.org
Subject: ka-Map-users Digest, Vol 11, Issue 7
Send ka-Map-users mailing list submissions to
ka-map-users at lists.maptools.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.maptools.org/mailman/listinfo/ka-map-users
or, via email, send a message with subject or body 'help' to
ka-map-users-request at lists.maptools.org
You can reach the person managing the list at
ka-map-users-owner at lists.maptools.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of ka-Map-users digest..."
Today's Topics:
1. kaXmlOverlay and ONMOUSEOVER() (Sepehr Sadeghi)
2. Re: kaXmlOverlay and ONMOUSEOVER() (Brent Pedersen)
3. Re: kaXmlOverlay and ONMOUSEOVER() (Sepehr Sadeghi)
4. Re: kaXmlOverlay and ONMOUSEOVER() (Brent Pedersen)
----------------------------------------------------------------------
Message: 1
Date: Fri, 3 Mar 2006 10:14:22 -0500
From: "Sepehr Sadeghi" <sadegs at alum.rpi.edu>
Subject: [ka-Map-users] kaXmlOverlay and ONMOUSEOVER()
To: ka-map-users at lists.maptools.org
Message-ID:
<696ac4ac0603030714j1fc0825fy22bc4d6726a23cf2 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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 ::..
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.maptools.org/pipermail/ka-map-users/attachments/20060303/7b71a0
a9/attachment-0001.html
------------------------------
Message: 2
Date: Fri, 3 Mar 2006 07:42:12 -0800
From: "Brent Pedersen" <bpederse at gmail.com>
Subject: Re: [ka-Map-users] kaXmlOverlay and ONMOUSEOVER()
To: "Sepehr Sadeghi" <sadegs at alum.rpi.edu>
Cc: ka-map-users at lists.maptools.org
Message-ID:
<e183a99d0603030742r374611d7nfe22bf7c6ee3bc37 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.maptools.org/pipermail/ka-map-users/attachments/20060303/36bbdc
03/attachment-0001.html
------------------------------
Message: 3
Date: Fri, 3 Mar 2006 11:39:27 -0500
From: "Sepehr Sadeghi" <sadegs at alum.rpi.edu>
Subject: Re: [ka-Map-users] kaXmlOverlay and ONMOUSEOVER()
To: "Brent Pedersen" <bpederse at gmail.com>
Cc: ka-map-users at lists.maptools.org
Message-ID:
<696ac4ac0603030839w49e99ecv2420d507291ce789 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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 ::..
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.maptools.org/pipermail/ka-map-users/attachments/20060303/f7f818
6b/attachment-0001.html
------------------------------
Message: 4
Date: Fri, 3 Mar 2006 08:47:03 -0800
From: "Brent Pedersen" <bpederse at gmail.com>
Subject: Re: [ka-Map-users] kaXmlOverlay and ONMOUSEOVER()
To: "Sepehr Sadeghi" <sadegs at alum.rpi.edu>,
ka-map-users at lists.maptools.org
Message-ID:
<e183a99d0603030847v1ca3e2dete747c641dabe35a7 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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 ::..
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.maptools.org/pipermail/ka-map-users/attachments/20060303/f80215
81/attachment-0001.html
------------------------------
_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ka-map-users
End of ka-Map-users Digest, Vol 11, Issue 7
*******************************************
More information about the ka-Map-users
mailing list