Remove unnecessary cast and save 15 bytes using goog.isDef

This commit is contained in:
Tim Schaub
2013-08-26 09:26:07 -06:00
parent 7e2bd66417
commit 0a3e46b88d

View File

@@ -150,8 +150,8 @@ ol.parser.GeoJSON.prototype.parseAsFeatureCollection_ = function(json,
}
}
var projection = 'EPSG:4326';
if (json.hasOwnProperty('crs')) {
var crs = /** GeoJSONCRS */ (json.crs);
if (goog.isDef(json.crs)) {
var crs = json.crs;
if (crs.type === 'name') {
projection = (/** GeoJSONCRSName */ (crs.properties)).name;
}