diff --git a/src/ol/format/geojsonformat.js b/src/ol/format/geojsonformat.js index 1d3d7da2bf..903affd392 100644 --- a/src/ol/format/geojsonformat.js +++ b/src/ol/format/geojsonformat.js @@ -7,7 +7,7 @@ goog.require('goog.array'); goog.require('goog.asserts'); goog.require('goog.object'); goog.require('ol.Feature'); -goog.require('ol.format.JSON'); +goog.require('ol.format.JSONFeature'); goog.require('ol.geom.GeometryCollection'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.LineString'); @@ -22,7 +22,7 @@ goog.require('ol.proj'); /** * @constructor - * @extends {ol.format.JSON} + * @extends {ol.format.JSONFeature} * @param {olx.format.GeoJSONOptions=} opt_options Options. * @todo stability experimental */ @@ -40,7 +40,7 @@ ol.format.GeoJSON = function(opt_options) { options.defaultProjection : 'EPSG:4326'); }; -goog.inherits(ol.format.GeoJSON, ol.format.JSON); +goog.inherits(ol.format.GeoJSON, ol.format.JSONFeature); /** diff --git a/src/ol/format/jsonformat.js b/src/ol/format/jsonfeatureformat.js similarity index 59% rename from src/ol/format/jsonformat.js rename to src/ol/format/jsonfeatureformat.js index 9bcd71a23c..9e2e3f9417 100644 --- a/src/ol/format/jsonformat.js +++ b/src/ol/format/jsonfeatureformat.js @@ -1,4 +1,4 @@ -goog.provide('ol.format.JSON'); +goog.provide('ol.format.JSONFeature'); goog.require('goog.asserts'); goog.require('goog.json'); @@ -11,10 +11,10 @@ goog.require('ol.format.FormatType'); * @constructor * @extends {ol.format.Feature} */ -ol.format.JSON = function() { +ol.format.JSONFeature = function() { goog.base(this); }; -goog.inherits(ol.format.JSON, ol.format.Feature); +goog.inherits(ol.format.JSONFeature, ol.format.Feature); /** @@ -22,7 +22,7 @@ goog.inherits(ol.format.JSON, ol.format.Feature); * @private * @return {Object} Object. */ -ol.format.JSON.prototype.getObject_ = function(source) { +ol.format.JSONFeature.prototype.getObject_ = function(source) { if (goog.isObject(source)) { return source; } else if (goog.isString(source)) { @@ -38,7 +38,7 @@ ol.format.JSON.prototype.getObject_ = function(source) { /** * @inheritDoc */ -ol.format.JSON.prototype.getType = function() { +ol.format.JSONFeature.prototype.getType = function() { return ol.format.FormatType.JSON; }; @@ -46,7 +46,7 @@ ol.format.JSON.prototype.getType = function() { /** * @inheritDoc */ -ol.format.JSON.prototype.readFeature = function(source) { +ol.format.JSONFeature.prototype.readFeature = function(source) { return this.readFeatureFromObject(this.getObject_(source)); }; @@ -54,7 +54,7 @@ ol.format.JSON.prototype.readFeature = function(source) { /** * @inheritDoc */ -ol.format.JSON.prototype.readFeatures = function(source) { +ol.format.JSONFeature.prototype.readFeatures = function(source) { return this.readFeaturesFromObject(this.getObject_(source)); }; @@ -64,7 +64,7 @@ ol.format.JSON.prototype.readFeatures = function(source) { * @protected * @return {ol.Feature} Feature. */ -ol.format.JSON.prototype.readFeatureFromObject = goog.abstractMethod; +ol.format.JSONFeature.prototype.readFeatureFromObject = goog.abstractMethod; /** @@ -72,13 +72,13 @@ ol.format.JSON.prototype.readFeatureFromObject = goog.abstractMethod; * @protected * @return {Array.} Features. */ -ol.format.JSON.prototype.readFeaturesFromObject = goog.abstractMethod; +ol.format.JSONFeature.prototype.readFeaturesFromObject = goog.abstractMethod; /** * @inheritDoc */ -ol.format.JSON.prototype.readGeometry = function(source) { +ol.format.JSONFeature.prototype.readGeometry = function(source) { return this.readGeometryFromObject(this.getObject_(source)); }; @@ -88,13 +88,13 @@ ol.format.JSON.prototype.readGeometry = function(source) { * @protected * @return {ol.geom.Geometry} Geometry. */ -ol.format.JSON.prototype.readGeometryFromObject = goog.abstractMethod; +ol.format.JSONFeature.prototype.readGeometryFromObject = goog.abstractMethod; /** * @inheritDoc */ -ol.format.JSON.prototype.readProjection = function(source) { +ol.format.JSONFeature.prototype.readProjection = function(source) { return this.readProjectionFromObject(this.getObject_(source)); }; @@ -104,13 +104,13 @@ ol.format.JSON.prototype.readProjection = function(source) { * @protected * @return {ol.proj.Projection} Projection. */ -ol.format.JSON.prototype.readProjectionFromObject = goog.abstractMethod; +ol.format.JSONFeature.prototype.readProjectionFromObject = goog.abstractMethod; /** * @inheritDoc */ -ol.format.JSON.prototype.writeFeature = function(feature) { +ol.format.JSONFeature.prototype.writeFeature = function(feature) { return this.writeFeatureObject(feature); }; @@ -120,13 +120,13 @@ ol.format.JSON.prototype.writeFeature = function(feature) { * @protected * @return {Object} Object. */ -ol.format.JSON.prototype.writeFeatureObject = goog.abstractMethod; +ol.format.JSONFeature.prototype.writeFeatureObject = goog.abstractMethod; /** * @inheritDoc */ -ol.format.JSON.prototype.writeFeatures = function(features) { +ol.format.JSONFeature.prototype.writeFeatures = function(features) { return this.writeFeaturesObject(features); }; @@ -136,13 +136,13 @@ ol.format.JSON.prototype.writeFeatures = function(features) { * @protected * @return {Object} Object. */ -ol.format.JSON.prototype.writeFeaturesObject = goog.abstractMethod; +ol.format.JSONFeature.prototype.writeFeaturesObject = goog.abstractMethod; /** * @inheritDoc */ -ol.format.JSON.prototype.writeGeometry = function(geometry) { +ol.format.JSONFeature.prototype.writeGeometry = function(geometry) { return this.writeGeometryObject(geometry); }; @@ -152,4 +152,4 @@ ol.format.JSON.prototype.writeGeometry = function(geometry) { * @protected * @return {Object} Object. */ -ol.format.JSON.prototype.writeGeometryObject = goog.abstractMethod; +ol.format.JSONFeature.prototype.writeGeometryObject = goog.abstractMethod; diff --git a/src/ol/format/topojsonformat.js b/src/ol/format/topojsonformat.js index 73c6f180fa..0c660b3b19 100644 --- a/src/ol/format/topojsonformat.js +++ b/src/ol/format/topojsonformat.js @@ -4,7 +4,7 @@ goog.require('goog.array'); goog.require('goog.asserts'); goog.require('goog.object'); goog.require('ol.Feature'); -goog.require('ol.format.JSON'); +goog.require('ol.format.JSONFeature'); goog.require('ol.geom.LineString'); goog.require('ol.geom.MultiLineString'); goog.require('ol.geom.MultiPoint'); @@ -17,7 +17,7 @@ goog.require('ol.proj'); /** * @constructor - * @extends {ol.format.JSON} + * @extends {ol.format.JSONFeature} * @param {olx.format.TopoJSONOptions=} opt_options Options. * @todo stability experimental */ @@ -35,7 +35,7 @@ ol.format.TopoJSON = function(opt_options) { ol.proj.get(options.defaultProjection || 'EPSG:4326'); }; -goog.inherits(ol.format.TopoJSON, ol.format.JSON); +goog.inherits(ol.format.TopoJSON, ol.format.JSONFeature); /**