Make projection retrieval consistent

This commit is contained in:
Andreas Hocevar
2014-07-28 20:01:35 +02:00
parent 4c4a335448
commit 464eb3ccf5
+3 -6
View File
@@ -72,11 +72,9 @@ ol.format.GeoJSON.readGeometry_ = function(object, opt_options) {
if (goog.isNull(object)) { if (goog.isNull(object)) {
return null; return null;
} }
var featureProjection = goog.isDef(opt_options) && var featureProjection = goog.isDef(opt_options) ?
goog.isDef(opt_options.featureProjection) ?
ol.proj.get(opt_options.featureProjection) : null; ol.proj.get(opt_options.featureProjection) : null;
var dataProjection = goog.isDef(opt_options) && var dataProjection = goog.isDef(opt_options) ?
goog.isDef(opt_options.dataProjection) ?
ol.proj.get(opt_options.dataProjection) : null; ol.proj.get(opt_options.dataProjection) : null;
var geometryReader = ol.format.GeoJSON.GEOMETRY_READERS_[object.type]; var geometryReader = ol.format.GeoJSON.GEOMETRY_READERS_[object.type];
goog.asserts.assert(goog.isDef(geometryReader)); goog.asserts.assert(goog.isDef(geometryReader));
@@ -187,8 +185,7 @@ ol.format.GeoJSON.writeGeometry_ = function(geometry, opt_options) {
goog.asserts.assert(goog.isDef(geometryWriter)); goog.asserts.assert(goog.isDef(geometryWriter));
var featureProjection = goog.isDef(opt_options) ? var featureProjection = goog.isDef(opt_options) ?
ol.proj.get(opt_options.featureProjection) : null; ol.proj.get(opt_options.featureProjection) : null;
var dataProjection = goog.isDef(opt_options) && var dataProjection = goog.isDef(opt_options) ?
goog.isDef(opt_options.dataProjection) ?
ol.proj.get(opt_options.dataProjection) : featureProjection; ol.proj.get(opt_options.dataProjection) : featureProjection;
if (!goog.isNull(featureProjection) && !goog.isNull(dataProjection) && if (!goog.isNull(featureProjection) && !goog.isNull(dataProjection) &&
!ol.proj.equivalent(featureProjection, dataProjection)) { !ol.proj.equivalent(featureProjection, dataProjection)) {