I'm using OpenLayers 2.12.
I try to load a GeoJSON-response from server and (nearly) everything works fine: but the properties contained in the GeoJSON-response ("nummer" and "befund" below) were put in a data-attribute of the feature-objects, not in their attributes-property, which I would expect. As observed in firebug, in the attributes-property I only find the names of my properties and empty strings as values.
Did I miss something, some parameters when creating the formatter or something like that? It's ugly to copy the values in every feature back to attributes...
My parsing function:
function parseGeoJson(featuresText) {
var formatter = new OpenLayers.Format.GeoJSON();
var features = formatter.read(featuresText);
if (features.length > 0) {
editor.editLayer.addFeatures(features);
}
}
My GeoJson:
{"type":"FeatureCollection",
"features":[
{"type":"Feature",
"properties":
{"nummer":"1",
"befund":"1.1.1"},
"geometry":{
"type":"Polygon",
"coordinates":[
[[15.37109375,81.11328125],[65.29296875,86.38671875],
[36.11328125,58.7890625],[15.37109375,81.11328125]]]
}
}]
}