On Jun 4, 7:53 pm, Rossko <[email protected]> wrote:
> > That worked...immediately when I replaced the lat=0 and lng=0 for
> > undefined's, it worked brilliantly.  thanks!

Er... well, it plots a marker at (0,0). Try clicking "Paseo de
Peralta" in your sidebar.

> Until the next time.
> Why not take the opportunity to make your javascript more robust, and
> not attempt to use values that may not be present in the XML, ignoring
> that line, or flag a warning alert or somesuch.  That way you'll be
> able to fix it yourself much quicker.

Definitely. For example, I suggested testing lat and lng and only
plotting a marker if both are non-zero. That means that Paseo de
Peralta won't appear, but you can't plot it in the right place without
accurate positional data anyway.

Or you could leave out those attributes as you were doing, but then
test for their presence before attempting to use them. It's called
"defensive programming".

What you don't want to do is to "solve" one problem by introducing
another -- putting your properties in the middle of the Atlantic, for
example.

Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to