"Format.GeoJSON does not parse features with null geometries", r=elemoine

(Closes #1145)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7689 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-08-04 10:38:01 +00:00
parent 21191ad0b9
commit 397de6fc6a
2 changed files with 15 additions and 0 deletions

View File

@@ -204,6 +204,9 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
* {<OpenLayers.Geometry>} A geometry.
*/
parseGeometry: function(obj) {
if (obj == null) {
return null;
}
var geometry;
if(obj.type == "GeometryCollection") {
if(!(obj.geometries instanceof Array)) {
@@ -532,6 +535,9 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
* {Object} An object representing the geometry.
*/
'geometry': function(geometry) {
if (geometry == null) {
return null;
}
if (this.internalProjection && this.externalProjection) {
geometry = geometry.clone();
geometry.transform(this.internalProjection,