[OpenLayers-Users] GML writer

Jim White jbw2003 at earthlink.net
Tue Mar 12 10:43:44 PDT 2013


Hi,

I am trying to write a spherical mercator vector layer to a GML file 
with projection lat/lon.

         var gml_writer = new OpenLayers.Format.GML.v3({
             featureType : 'MultiPolygon',
             featureNS : 'http://jimserver.net/',
             geometryName : 'aoi'
         });
         var i, feature_clone, geometry, feature;
         var myfeatures = [];
         for ( i = 0; i < highlightLayer.features.length; i++) {
             feature = highlightLayer.features[i];
             geometry = feature.geometry.clone();
             geometry.transform(proj_900913, proj_4326);
             feature = new OpenLayers.Feature.Vector({
                 geometry : geometry
             });
             myfeatures.push(feature);
         }
         var gml = gml_writer.write(myfeatures);

However, this code gives error:

TypeError: this.writers[d][a] is undefined

What is wrong with this code, or is there a better way to do this?

Thanks,
Jim


-- 
James B. White
Cary, NC
H: 919-380-9615
M: 919-698-1765
White Coding and Maps <http://whitecodingandmaps.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130312/b713060c/attachment.html>


More information about the Users mailing list