I would like to use OpenLayers 3 to write GML features.
Here is my code:
proj4.defs("EPSG:25833", "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");
prjCrs.epsg25832 = ol.proj.get('EPSG:25832');
prjCrs.epsg4326 = 'EPSG:4326';
var features = digitizingVector.getSource().getFeatures();
var format = new ol.format.GML();
var out = format.writeFeatures(features, {
dataProjection: prjCrs.epsg4326,
featureProjection: prjCrs.epsg25832
});
However, this always spits out the following error message:
ol.js:357 Uncaught TypeError: Cannot read property 'undefined' of undefined
With ol-debug.js
the following error message is returned:
I am using the exact same logic to write features in GeoJSON, KML, GPX, WKT and it works perfecty fine. Is there an issue with GML features in OpenLayers 3?
I am using version 3.19.1 of OpenLayers.