[OpenLayers-Users] Are String objects limited to 4096 characters?

Stephen Woodbridge woodbri at swoodbridge.com
Wed May 20 11:01:10 EDT 2009


Christopher Schmidt wrote:
> On Tue, May 19, 2009 at 02:58:53PM -0400, Stephen Woodbridge wrote:
>> Hi all,
>>
>> I'm trying to parse some WKT out of an XML document in an OpenLayers 
>> application and one of my WKT text nodes is getting truncated at 4096 
>> character! The XML document is good, but when I extract the text from 
>> the XML node it is getting truncated.
>>
>> It seems to work in IE 6.0.2800 and Opera 9.64, but not FF 3.0.10.
>>
>> So is looks like FF breaks the text into an array of strings where each 
>> is 4096 characters or less. Can I pass this array to the WKT parser read 
>> function? Or can I concat the items into a string?
> 
> http://dev.openlayers.org/apidocs/files/OpenLayers/Format/XML-js.html#OpenLayers.Format.XML.getChildValue
> 
> -- Chris

Thank you again. I took the day and tossed my old code, and wrote a new 
reader that inherited from OpenLayers.Format.XML and it was pretty 
straight forward. New code works great and it much cleaner than my old 
hack. I'm not sure why I did not do this in the first place ... oh well!

Reading through OL code and the API, I see that concatChildValues() is 
depreciated and it points to getChildValue() which appears to only get 
the first child.

Is getChildValue() doing something tricky that I missed?

I also see getChildEl() and getNextEl() which might be used to loop 
through the children to concat the results.

Regards,
   -Steve

>> var parser = new OpenLayers.Format.WKT();
>> var edges = xmldoc.getElementsByTagNameNS('*', 'edge');
>> var wkt = edges[0].getElementsByTagNameNS('*', 'wkt');
>> var g = parser.read(wkt);
>>
>> Any help or suggestions would be appreciated.
>>
>> Thanks,
>>    -Steve
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> 




More information about the Users mailing list