The method I used with polygons is to build a list, (in a hash), of the tile numbers that the polygon touches, and then loop that list painting the polygon onto each tile, using $polygon->offset(dX,dY) before drawing. This implies that the tiles are saved to disk.
If you are using $image->ellipse($cx,$cy,$width,$height,$color) then you can do the same, but shifting the values of $cx and $cy by 256. If you use $polygon->offset(dX,dY) remember to offset back with $polygon->offset(-dX,-dY) in case the polygon goes over more than two tiles and needs to be offset again. If you're using GD::Polygon and $image->filledPolygon() beware of this bug when drawing at the bottom edge of the tile: http://www.webfoot.com/blog/2007/08/12/robobait-gd-library-bug-horizontal-lines/ -- Marcelo - http://maps.forum.nu -- On Apr 14, 8:16 pm, StephenGMap <[email protected]> wrote: > I built a cool tile demo based on the excellent "Google Maps > Applications with PHP and Ajax" book. > > I use php and the gd library to dynamically plot dots on my tile. > I've noticed that my dots (which are about 10 pixels wide) are sliced > where they interect with tile boundaries. > > This obviously occurs because I'm only plotting the points on one > tile. Clearly I need to plot the part thats sliced off on the > neigboring tile also. > > Its not clear to me how I would do that. Is there an algorithm or > technique that people on the board have used to achieve this ? One > way might be to plot 262x262 (256+1/2 width of my widest dot) on each > tile and then trim the edges back to 256 before displaying > > Stephen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
