Will Cadell
unread,Nov 26, 2010, 12:53:47 PM11/26/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-map...@googlegroups.com
i remember having a bit of a time getting the whole infowindow from a looped series of database driven polys thing top work first time...
here is my breakdown:
define global infowindow variable
define global polygonArray variable
call php (or whatever) function and loop through results set
>getPoly() - on each record:
pull attributes you need
build geometry (from attributes in record set, likely as MVC array)
> call function to actually define polygon feature (with various attributes and geometry as arguments)this will return a polygon object
makePoly(geometry, val1, var2)
> makes the polygon using standard syntax, then call another function called makeClick(var1, var2)
add the click event here using the infowindow as your base...
>return to makePoly (polygon with click event attached)
> return to getPoly as poly with click attached
>add record to polygon array (push)
then, still in getPoly function polygonArray[i].setMap(map)
this should leave you with an array of polys each with a click event... I hope that is useful!
remember, firebug is your friend!
good luck, w