[ka-Map-users] Problems with addObjectGeo again.

Samuel Doyle sdoyle_2 at yahoo.com
Fri Aug 25 16:09:00 EDT 2006


Perhaps it has something to do with the various style sheets and such that are being used. Guess I'll just need to overcome it via brute force but even doing this still results in a lot of drift when viewed on different scales.

S.D.

Paul Spencer <pspencer at dmsolutions.ca> wrote: The problem is likely with e.clientX/Y.  I've started using:

     e = (e)?e:((event)?event:null);
     var x = e.pageX || (e.clientX +
         (document.documentElement.scrollLeft ||  
document.body.scrollLeft));
     var y = e.pageY || (e.clientY +
         (document.documentElement.scrollTop ||  
document.body.scrollTop));
     var a = this.adjustPixPosition( x,y );
     var p = this.kaMap.pixToGeo( a[0], a[1] );

and haven't run into any problems

Cheers

Paul

On 25-Aug-06, at 2:34 PM, Samuel Doyle wrote:

> It's mapped to the adjustPixPosition in kaTool.
>
> S.D.
>
> Christopher Schmidt  wrote: On Fri, Aug  
> 25, 2006 at 10:42:24AM -0700, Samuel Doyle wrote:
> > Has anyone else encountered this? Is this something I need to  
> manually compensate for?
> >
> > Samuel Doyle wrote: Hi,
> >
> > I keep running into this problem and it behaves different on both  
> Firefox and IE.
> >
> > I want to add an icon to the map based on where the user has  
> clicked. I use the following procedure which I am hoping is correct  
> since I have noticed it used before.
> >
> > incidentViewer.prototype.ondblclick = function(e)
> > {
> > e = (e)?e:((event)?event:null);
> >
> > var aPixPos = this.adjustPixPosition( e.clientX, e.clientY );
> > var geoCoo = this.kaMap.pixToGeo( aPixPos[0], aPixPos[1] );
> > this.gX = geoCoo[0];
> > this.gY = geoCoo[1];
> > // send to server here
> > ...
> >
> > myKaMap.addObjectGeo( opener.iconFeatures, this.gY, this.gX,  
> incident.img );
> >
> > }
> >
> > The offset of the icon always ends up incorrect from what it  
> should be. Is this the correct procedure?
>
> Whether this is correct or not would depend on what the code in
> "this.adjustPixPosition" does.
>
> Regards,
> -- 
> Christopher Schmidt
> Web Developer
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060825/ee65b58b/attachment-0001.html


More information about the ka-Map-users mailing list