[ka-Map-users] Efficient Point Collision

Lorenzo Becchi lorenzo at ominiverdi.com
Sat Oct 21 15:37:01 EDT 2006

 > To break it down each time a marker is placed it loops through  
each already
 > placed marker stored in a makers array to test for collision based  
on pixel
 > distance using "var distance = Math.sqrt(Math.pow((Math.pow 
((thisNodeLeft -
 > otherNodeLeft),2) + Math.pow((thisNodeTop - otherNodeTop),2)), 
1));", this
 > system works great for around 50 markers but often my apps will  
place 500+
 > makers which runs just fine until I collision check them as the  
loop just
 > becomes huge and obviously causes the browser to hang.

Hi Chris,

why don't you do this calculation server side?

after your calculation you send back the browser just the resulting  
points with the aggregated value.

did you tried?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20061021/521ab1b0/attachment.html

More information about the ka-Map-users mailing list