[ka-Map-users] why are my points slightly off when drawing on the map?

Donal Regan donal_regan10 at yahoo.co.uk
Fri Sep 1 05:45:24 EDT 2006


Hello.

I'm trying to draw small polygons and lines using wz_graphics but the positioning of my shapes is off by a couple of pixels in both Firefox and IE.

I create a drawing canvas using kaMap.createDrawingCanvas().

myDrawToolsCanvas = myKaMap.createDrawingCanvas();
myDrawToolsCanvas.id="myDrawToolsCanvas";
    jg = new jsGraphics("myDrawToolsCanvas");

Then, as I click on my map  I basically do something like 

x_coords.push(e.clientX - parseInt(myKaMap.theInsideLayer.style.left))
y_coords.push(e.clientY - parseInt(myKaMap.theInsideLayer.style.Top))
jg.drawPolygon(this.x_coords, this.y_coords);

What can I do to avoid the slight offset that I'm seeing?

I saw someone had a similar issue 

http://lists.maptools.org/pipermail/ka-map-users/2006-August/002137.html

but there was no follow - up re: the 2nd point .

Cheers,

Donal


 		
---------------------------------
 Inbox full of spam? Get leading spam protection and 1GB storage with All New Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060901/d2c5c404/attachment.html


More information about the ka-Map-users mailing list