That works perfectly. Thanks a lot. I'll need to keep that in mind, it never occurred to me that Firefox would do that.
On 28 July 2010 23:58, William <william.g...@gmail.com> wrote: > On Jul 29, 7:08 am, Incubuss <cyb...@gmail.com> wrote: > > > > One again, any help would be greatly appreciated. I'm rather confused > > as to why it works in Chrome and IE but not Firefox. > > > > it's because in XML only Firefox splits up long text nodes into many > text nodes, so to get the value of a tag you need to concatenate the > node values. In Firefox the long coordinate string was being > truncated to the value of the first text node. > > /** > * Get the value of an xml tag by name > */ > > // instead of this: > > function getValue( xml, name ) { > return xml.getElementsByTagName( name )[0].childNodes[0].nodeValue; > } > > // use a function something like this: > > function getTagValue(node, tag) { > var tags = node.getElementsByTagName(tag); > if (tags.length > 0 && tags.item(0).childNodes.length > 0) { > var s = ""; > for (var i=0; i<tags.item(0).childNodes.length; i++) { > s += tags.item(0).childNodes[i].nodeValue; > } > return s; > } else { > return null; > } > } > > ... > > -- > 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 > google-maps-js-api...@googlegroups.com. > To unsubscribe from this group, send email to > google-maps-js-api-v3+unsubscr...@googlegroups.com<google-maps-js-api-v3%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- 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 google-maps-js-api...@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.