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 <[email protected]> wrote: > On Jul 29, 7:08 am, Incubuss <[email protected]> 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 > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-maps-js-api-v3%[email protected]> > . > 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 [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.
