> the error console keeps telling me that var poly is undefined.

As in your thread in the other group, your inline code calls your
addRuta() function while the webpage is loading.  That fails, because
no map or poly objects are yet intialized.  That initializing takes
place later, triggered by the end of page loading.

> I've been told taht a possible solution would be to write the problem
> function in the initialize function, but I can't do that

It's just a case of writing your addRuta() calls into a different
place, so that when the page is delivered to the browser they are at
the end of your initialize() function, so that they run after the map
is ready.

If you can't manage that, consider a different approach:  Don't write
dynamic javascript into your webpage at all, write fixed javascript
that fetches the dynamic data from a php servlet.
For inspiration:
http://code.google.com/apis/maps/articles/phpsqlajax_v3.html
fetches and displays dynamic data.  It needn't be from a database, you
can have your php get and process data from a text file and return it
to the webpage.
http://code.google.com/apis/maps/articles/phpsqlsearch_v3.html
fetches and displays dynamic data according to passed parameters.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to