[OpenLayers-Users] Vector/GML Question

Christopher Schmidt crschmidt at metacarta.com
Wed Mar 28 14:01:29 EDT 2007


On Wed, Mar 28, 2007 at 09:46:28AM -0700, Roger Kunkel wrote:
> Thanks , that looks like what I need.
> 
> But, after
> 
> >gml = new OpenLayers.Format.GML();
> >data = gml.write([feature,feature]);
> 
> 
> I see that data is an featurecollection object. I want to look at the  
> gml as text. How do I write it as text?

Depends on your browser.

 * Safari can't serialize it as proper GML. (No namespaces.)
 * IE can't serialize it at all (no XMLSerializer object).

If you look at http://openlayers.org/dev/examples/gml-serialize.html ,
you can see a way to do it that works for Firefox  and Opera.

If you want to serialize generally, you will need to investigate
solutions that are written in Javascript: It looks like
http://dotnetjunkies.com/WebLog/anoras/articles/21960.aspx is a
client-side Javascript serializer, from a quick Google search, but I
haven't used anything other than XMLSerializer for this task. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list