Rename _ol_format_Feature_ to FeatureFormat
This commit is contained in:
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
|||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_asserts_ from '../asserts.js';
|
import _ol_asserts_ from '../asserts.js';
|
||||||
import {containsExtent} from '../extent.js';
|
import {containsExtent} from '../extent.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
@@ -84,7 +84,7 @@ EsriJSON.readGeometry_ = function(object, opt_options) {
|
|||||||
}
|
}
|
||||||
var geometryReader = EsriJSON.GEOMETRY_READERS_[type];
|
var geometryReader = EsriJSON.GEOMETRY_READERS_[type];
|
||||||
return (
|
return (
|
||||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
|
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
|
||||||
geometryReader(object), false, opt_options)
|
geometryReader(object), false, opt_options)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -563,7 +563,7 @@ EsriJSON.prototype.readProjectionFromObject = function(object) {
|
|||||||
EsriJSON.writeGeometry_ = function(geometry, opt_options) {
|
EsriJSON.writeGeometry_ = function(geometry, opt_options) {
|
||||||
var geometryWriter = EsriJSON.GEOMETRY_WRITERS_[geometry.getType()];
|
var geometryWriter = EsriJSON.GEOMETRY_WRITERS_[geometry.getType()];
|
||||||
return geometryWriter(/** @type {ol.geom.Geometry} */(
|
return geometryWriter(/** @type {ol.geom.Geometry} */(
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, true, opt_options)),
|
FeatureFormat.transformWithOptions(geometry, true, opt_options)),
|
||||||
opt_options);
|
opt_options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_format_Feature_ = function() {
|
var FeatureFormat = function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
@@ -42,7 +42,7 @@ var _ol_format_Feature_ = function() {
|
|||||||
* @return {olx.format.ReadOptions|undefined} Options.
|
* @return {olx.format.ReadOptions|undefined} Options.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.getReadOptions = function(source, opt_options) {
|
FeatureFormat.prototype.getReadOptions = function(source, opt_options) {
|
||||||
var options;
|
var options;
|
||||||
if (opt_options) {
|
if (opt_options) {
|
||||||
options = {
|
options = {
|
||||||
@@ -64,7 +64,7 @@ _ol_format_Feature_.prototype.getReadOptions = function(source, opt_options) {
|
|||||||
* @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined}
|
* @return {olx.format.WriteOptions|olx.format.ReadOptions|undefined}
|
||||||
* Updated options.
|
* Updated options.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.adaptOptions = function(options) {
|
FeatureFormat.prototype.adaptOptions = function(options) {
|
||||||
return _ol_obj_.assign({
|
return _ol_obj_.assign({
|
||||||
dataProjection: this.defaultDataProjection,
|
dataProjection: this.defaultDataProjection,
|
||||||
featureProjection: this.defaultFeatureProjection
|
featureProjection: this.defaultFeatureProjection
|
||||||
@@ -76,7 +76,7 @@ _ol_format_Feature_.prototype.adaptOptions = function(options) {
|
|||||||
* Get the extent from the source of the last {@link readFeatures} call.
|
* Get the extent from the source of the last {@link readFeatures} call.
|
||||||
* @return {ol.Extent} Tile extent.
|
* @return {ol.Extent} Tile extent.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.getLastExtent = function() {
|
FeatureFormat.prototype.getLastExtent = function() {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ _ol_format_Feature_.prototype.getLastExtent = function() {
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @return {ol.format.FormatType} Format.
|
* @return {ol.format.FormatType} Format.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.getType = function() {};
|
FeatureFormat.prototype.getType = function() {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,7 +96,7 @@ _ol_format_Feature_.prototype.getType = function() {};
|
|||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.Feature} Feature.
|
* @return {ol.Feature} Feature.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.readFeature = function(source, opt_options) {};
|
FeatureFormat.prototype.readFeature = function(source, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +107,7 @@ _ol_format_Feature_.prototype.readFeature = function(source, opt_options) {};
|
|||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<ol.Feature>} Features.
|
* @return {Array.<ol.Feature>} Features.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.readFeatures = function(source, opt_options) {};
|
FeatureFormat.prototype.readFeatures = function(source, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,7 +118,7 @@ _ol_format_Feature_.prototype.readFeatures = function(source, opt_options) {};
|
|||||||
* @param {olx.format.ReadOptions=} opt_options Read options.
|
* @param {olx.format.ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {ol.geom.Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.readGeometry = function(source, opt_options) {};
|
FeatureFormat.prototype.readGeometry = function(source, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -128,7 +128,7 @@ _ol_format_Feature_.prototype.readGeometry = function(source, opt_options) {};
|
|||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {ol.proj.Projection} Projection.
|
* @return {ol.proj.Projection} Projection.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.readProjection = function(source) {};
|
FeatureFormat.prototype.readProjection = function(source) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,7 +139,7 @@ _ol_format_Feature_.prototype.readProjection = function(source) {};
|
|||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.writeFeature = function(feature, opt_options) {};
|
FeatureFormat.prototype.writeFeature = function(feature, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,7 +150,7 @@ _ol_format_Feature_.prototype.writeFeature = function(feature, opt_options) {};
|
|||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.writeFeatures = function(features, opt_options) {};
|
FeatureFormat.prototype.writeFeatures = function(features, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -161,7 +161,7 @@ _ol_format_Feature_.prototype.writeFeatures = function(features, opt_options) {}
|
|||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.prototype.writeGeometry = function(geometry, opt_options) {};
|
FeatureFormat.prototype.writeGeometry = function(geometry, opt_options) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,7 +172,7 @@ _ol_format_Feature_.prototype.writeGeometry = function(geometry, opt_options) {}
|
|||||||
* @return {ol.geom.Geometry|ol.Extent} Transformed geometry.
|
* @return {ol.geom.Geometry|ol.Extent} Transformed geometry.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
_ol_format_Feature_.transformWithOptions = function(
|
FeatureFormat.transformWithOptions = function(
|
||||||
geometry, write, opt_options) {
|
geometry, write, opt_options) {
|
||||||
var featureProjection = opt_options ?
|
var featureProjection = opt_options ?
|
||||||
getProjection(opt_options.featureProjection) : null;
|
getProjection(opt_options.featureProjection) : null;
|
||||||
@@ -219,4 +219,4 @@ _ol_format_Feature_.transformWithOptions = function(
|
|||||||
}
|
}
|
||||||
return transformed;
|
return transformed;
|
||||||
};
|
};
|
||||||
export default _ol_format_Feature_;
|
export default FeatureFormat;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import {createOrUpdate} from '../extent.js';
|
import {createOrUpdate} from '../extent.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||||
import _ol_format_XSD_ from '../format/XSD.js';
|
import _ol_format_XSD_ from '../format/XSD.js';
|
||||||
import Geometry from '../geom/Geometry.js';
|
import Geometry from '../geom/Geometry.js';
|
||||||
@@ -296,7 +296,7 @@ _ol_format_GML2_.prototype.writeGeometryElement = function(node, geometry, objec
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value =
|
value =
|
||||||
_ol_format_Feature_.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
FeatureFormat.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
||||||
}
|
}
|
||||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||||
(item), _ol_format_GML2_.GEOMETRY_SERIALIZERS_,
|
(item), _ol_format_GML2_.GEOMETRY_SERIALIZERS_,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_array_ from '../array.js';
|
import _ol_array_ from '../array.js';
|
||||||
import {createOrUpdate} from '../extent.js';
|
import {createOrUpdate} from '../extent.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||||
import _ol_format_XSD_ from '../format/XSD.js';
|
import _ol_format_XSD_ from '../format/XSD.js';
|
||||||
import Geometry from '../geom/Geometry.js';
|
import Geometry from '../geom/Geometry.js';
|
||||||
@@ -963,7 +963,7 @@ _ol_format_GML3_.prototype.writeGeometryElement = function(node, geometry, objec
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value =
|
value =
|
||||||
_ol_format_Feature_.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
FeatureFormat.transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
||||||
}
|
}
|
||||||
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
_ol_xml_.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */
|
||||||
(item), _ol_format_GML3_.GEOMETRY_SERIALIZERS_,
|
(item), _ol_format_GML3_.GEOMETRY_SERIALIZERS_,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_array_ from '../array.js';
|
import _ol_array_ from '../array.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
@@ -205,7 +205,7 @@ _ol_format_GMLBase_.prototype.readGeometryElement = function(node, objectStack)
|
|||||||
this.GEOMETRY_PARSERS_, node, objectStack, this);
|
this.GEOMETRY_PARSERS_, node, objectStack, this);
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
return (
|
return (
|
||||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(geometry, false, context)
|
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(geometry, false, context)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_array_ from '../array.js';
|
import _ol_array_ from '../array.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||||
import _ol_format_XSD_ from '../format/XSD.js';
|
import _ol_format_XSD_ from '../format/XSD.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
@@ -242,7 +242,7 @@ _ol_format_GPX_.readRte_ = function(node, objectStack) {
|
|||||||
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates);
|
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates);
|
||||||
var geometry = new LineString(null);
|
var geometry = new LineString(null);
|
||||||
geometry.setFlatCoordinates(layout, flatCoordinates);
|
geometry.setFlatCoordinates(layout, flatCoordinates);
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||||
var feature = new _ol_Feature_(geometry);
|
var feature = new _ol_Feature_(geometry);
|
||||||
feature.setProperties(values);
|
feature.setProperties(values);
|
||||||
return feature;
|
return feature;
|
||||||
@@ -275,7 +275,7 @@ _ol_format_GPX_.readTrk_ = function(node, objectStack) {
|
|||||||
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates, ends);
|
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, flatCoordinates, ends);
|
||||||
var geometry = new MultiLineString(null);
|
var geometry = new MultiLineString(null);
|
||||||
geometry.setFlatCoordinates(layout, flatCoordinates, ends);
|
geometry.setFlatCoordinates(layout, flatCoordinates, ends);
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||||
var feature = new _ol_Feature_(geometry);
|
var feature = new _ol_Feature_(geometry);
|
||||||
feature.setProperties(values);
|
feature.setProperties(values);
|
||||||
return feature;
|
return feature;
|
||||||
@@ -299,7 +299,7 @@ _ol_format_GPX_.readWpt_ = function(node, objectStack) {
|
|||||||
var coordinates = _ol_format_GPX_.appendCoordinate_([], layoutOptions, node, values);
|
var coordinates = _ol_format_GPX_.appendCoordinate_([], layoutOptions, node, values);
|
||||||
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, coordinates);
|
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, coordinates);
|
||||||
var geometry = new Point(coordinates, layout);
|
var geometry = new Point(coordinates, layout);
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||||
var feature = new _ol_Feature_(geometry);
|
var feature = new _ol_Feature_(geometry);
|
||||||
feature.setProperties(values);
|
feature.setProperties(values);
|
||||||
return feature;
|
return feature;
|
||||||
@@ -630,7 +630,7 @@ _ol_format_GPX_.writeRte_ = function(node, feature, objectStack) {
|
|||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = /** @type {ol.geom.LineString} */
|
geometry = /** @type {ol.geom.LineString} */
|
||||||
(_ol_format_Feature_.transformWithOptions(geometry, true, options));
|
(FeatureFormat.transformWithOptions(geometry, true, options));
|
||||||
context['geometryLayout'] = geometry.getLayout();
|
context['geometryLayout'] = geometry.getLayout();
|
||||||
properties['rtept'] = geometry.getCoordinates();
|
properties['rtept'] = geometry.getCoordinates();
|
||||||
}
|
}
|
||||||
@@ -657,7 +657,7 @@ _ol_format_GPX_.writeTrk_ = function(node, feature, objectStack) {
|
|||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = /** @type {ol.geom.MultiLineString} */
|
geometry = /** @type {ol.geom.MultiLineString} */
|
||||||
(_ol_format_Feature_.transformWithOptions(geometry, true, options));
|
(FeatureFormat.transformWithOptions(geometry, true, options));
|
||||||
properties['trkseg'] = geometry.getLineStrings();
|
properties['trkseg'] = geometry.getLineStrings();
|
||||||
}
|
}
|
||||||
var parentNode = objectStack[objectStack.length - 1].node;
|
var parentNode = objectStack[objectStack.length - 1].node;
|
||||||
@@ -698,7 +698,7 @@ _ol_format_GPX_.writeWpt_ = function(node, feature, objectStack) {
|
|||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = /** @type {ol.geom.Point} */
|
geometry = /** @type {ol.geom.Point} */
|
||||||
(_ol_format_Feature_.transformWithOptions(geometry, true, options));
|
(FeatureFormat.transformWithOptions(geometry, true, options));
|
||||||
context['geometryLayout'] = geometry.getLayout();
|
context['geometryLayout'] = geometry.getLayout();
|
||||||
_ol_format_GPX_.writeWptType_(node, geometry.getCoordinates(), objectStack);
|
_ol_format_GPX_.writeWptType_(node, geometry.getCoordinates(), objectStack);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_asserts_ from '../asserts.js';
|
import _ol_asserts_ from '../asserts.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
@@ -77,7 +77,7 @@ _ol_format_GeoJSON_.readGeometry_ = function(object, opt_options) {
|
|||||||
}
|
}
|
||||||
var geometryReader = _ol_format_GeoJSON_.GEOMETRY_READERS_[object.type];
|
var geometryReader = _ol_format_GeoJSON_.GEOMETRY_READERS_[object.type];
|
||||||
return (
|
return (
|
||||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
|
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
|
||||||
geometryReader(object), false, opt_options)
|
geometryReader(object), false, opt_options)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -172,7 +172,7 @@ _ol_format_GeoJSON_.readPolygonGeometry_ = function(object) {
|
|||||||
_ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) {
|
_ol_format_GeoJSON_.writeGeometry_ = function(geometry, opt_options) {
|
||||||
var geometryWriter = _ol_format_GeoJSON_.GEOMETRY_WRITERS_[geometry.getType()];
|
var geometryWriter = _ol_format_GeoJSON_.GEOMETRY_WRITERS_[geometry.getType()];
|
||||||
return geometryWriter(/** @type {ol.geom.Geometry} */ (
|
return geometryWriter(/** @type {ol.geom.Geometry} */ (
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, true, opt_options)),
|
FeatureFormat.transformWithOptions(geometry, true, opt_options)),
|
||||||
opt_options);
|
opt_options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_IGCZ_ from '../format/IGCZ.js';
|
import _ol_format_IGCZ_ from '../format/IGCZ.js';
|
||||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
@@ -161,7 +161,7 @@ _ol_format_IGC_.prototype.readFeatureFromText = function(text, opt_options) {
|
|||||||
var layout = altitudeMode == _ol_format_IGCZ_.NONE ?
|
var layout = altitudeMode == _ol_format_IGCZ_.NONE ?
|
||||||
GeometryLayout.XYM : GeometryLayout.XYZM;
|
GeometryLayout.XYM : GeometryLayout.XYZM;
|
||||||
lineString.setFlatCoordinates(layout, flatCoordinates);
|
lineString.setFlatCoordinates(layout, flatCoordinates);
|
||||||
var feature = new _ol_Feature_(_ol_format_Feature_.transformWithOptions(
|
var feature = new _ol_Feature_(FeatureFormat.transformWithOptions(
|
||||||
lineString, false, opt_options));
|
lineString, false, opt_options));
|
||||||
feature.setProperties(properties);
|
feature.setProperties(properties);
|
||||||
return feature;
|
return feature;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/format/JSONFeature
|
* @module ol/format/JSONFeature
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,10 +16,10 @@ import _ol_format_FormatType_ from '../format/FormatType.js';
|
|||||||
* @extends {ol.format.Feature}
|
* @extends {ol.format.Feature}
|
||||||
*/
|
*/
|
||||||
var _ol_format_JSONFeature_ = function() {
|
var _ol_format_JSONFeature_ = function() {
|
||||||
_ol_format_Feature_.call(this);
|
FeatureFormat.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_format_JSONFeature_, _ol_format_Feature_);
|
inherits(_ol_format_JSONFeature_, FeatureFormat);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import _ol_Feature_ from '../Feature.js';
|
|||||||
import _ol_array_ from '../array.js';
|
import _ol_array_ from '../array.js';
|
||||||
import _ol_asserts_ from '../asserts.js';
|
import _ol_asserts_ from '../asserts.js';
|
||||||
import _ol_color_ from '../color.js';
|
import _ol_color_ from '../color.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||||
import _ol_format_XSD_ from '../format/XSD.js';
|
import _ol_format_XSD_ from '../format/XSD.js';
|
||||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||||
@@ -1716,7 +1716,7 @@ _ol_format_KML_.prototype.readPlacemark_ = function(node, objectStack) {
|
|||||||
|
|
||||||
var geometry = object['geometry'];
|
var geometry = object['geometry'];
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||||
}
|
}
|
||||||
feature.setGeometry(geometry);
|
feature.setGeometry(geometry);
|
||||||
delete object['geometry'];
|
delete object['geometry'];
|
||||||
@@ -2471,7 +2471,7 @@ _ol_format_KML_.writePlacemark_ = function(node, feature, objectStack) {
|
|||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry =
|
geometry =
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, true, options);
|
FeatureFormat.transformWithOptions(geometry, true, options);
|
||||||
}
|
}
|
||||||
_ol_xml_.pushSerializeAndPop(context, _ol_format_KML_.PLACEMARK_SERIALIZERS_,
|
_ol_xml_.pushSerializeAndPop(context, _ol_format_KML_.PLACEMARK_SERIALIZERS_,
|
||||||
_ol_format_KML_.GEOMETRY_NODE_FACTORY_, [geometry], objectStack);
|
_ol_format_KML_.GEOMETRY_NODE_FACTORY_, [geometry], objectStack);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_asserts_ from '../asserts.js';
|
import _ol_asserts_ from '../asserts.js';
|
||||||
import PBF from 'pbf';
|
import PBF from 'pbf';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
@@ -32,7 +32,7 @@ import _ol_render_Feature_ from '../render/Feature.js';
|
|||||||
*/
|
*/
|
||||||
var _ol_format_MVT_ = function(opt_options) {
|
var _ol_format_MVT_ = function(opt_options) {
|
||||||
|
|
||||||
_ol_format_Feature_.call(this);
|
FeatureFormat.call(this);
|
||||||
|
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ var _ol_format_MVT_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_format_MVT_, _ol_format_Feature_);
|
inherits(_ol_format_MVT_, FeatureFormat);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -322,7 +322,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
|
|||||||
if (this.geometryName_) {
|
if (this.geometryName_) {
|
||||||
feature.setGeometryName(this.geometryName_);
|
feature.setGeometryName(this.geometryName_);
|
||||||
}
|
}
|
||||||
var geometry = _ol_format_Feature_.transformWithOptions(geom, false, this.adaptOptions(opt_options));
|
var geometry = FeatureFormat.transformWithOptions(geom, false, this.adaptOptions(opt_options));
|
||||||
feature.setGeometry(geometry);
|
feature.setGeometry(geometry);
|
||||||
feature.setId(id);
|
feature.setId(id);
|
||||||
feature.setProperties(values);
|
feature.setProperties(values);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_array_ from '../array.js';
|
import _ol_array_ from '../array.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
@@ -57,7 +57,7 @@ _ol_format_OSMXML_.readNode_ = function(node, objectStack) {
|
|||||||
}, _ol_format_OSMXML_.NODE_PARSERS_, node, objectStack);
|
}, _ol_format_OSMXML_.NODE_PARSERS_, node, objectStack);
|
||||||
if (!_ol_obj_.isEmpty(values.tags)) {
|
if (!_ol_obj_.isEmpty(values.tags)) {
|
||||||
var geometry = new Point(coordinates);
|
var geometry = new Point(coordinates);
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||||
var feature = new _ol_Feature_(geometry);
|
var feature = new _ol_Feature_(geometry);
|
||||||
feature.setId(id);
|
feature.setId(id);
|
||||||
feature.setProperties(values.tags);
|
feature.setProperties(values.tags);
|
||||||
@@ -192,7 +192,7 @@ _ol_format_OSMXML_.prototype.readFeaturesFromNode = function(node, opt_options)
|
|||||||
geometry = new LineString(null);
|
geometry = new LineString(null);
|
||||||
geometry.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
geometry.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
||||||
}
|
}
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, options);
|
FeatureFormat.transformWithOptions(geometry, false, options);
|
||||||
var feature = new _ol_Feature_(geometry);
|
var feature = new _ol_Feature_(geometry);
|
||||||
feature.setId(values.id);
|
feature.setId(values.id);
|
||||||
feature.setProperties(values.tags);
|
feature.setProperties(values.tags);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_asserts_ from '../asserts.js';
|
import _ol_asserts_ from '../asserts.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
@@ -333,7 +333,7 @@ _ol_format_Polyline_.prototype.readGeometryFromText = function(text, opt_options
|
|||||||
flatCoordinates, 0, flatCoordinates.length, stride);
|
flatCoordinates, 0, flatCoordinates.length, stride);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(
|
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(
|
||||||
new LineString(coordinates, this.geometryLayout_), false,
|
new LineString(coordinates, this.geometryLayout_), false,
|
||||||
this.adaptOptions(opt_options))
|
this.adaptOptions(opt_options))
|
||||||
);
|
);
|
||||||
@@ -390,7 +390,7 @@ _ol_format_Polyline_.prototype.writeGeometry;
|
|||||||
*/
|
*/
|
||||||
_ol_format_Polyline_.prototype.writeGeometryText = function(geometry, opt_options) {
|
_ol_format_Polyline_.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||||
geometry = /** @type {ol.geom.LineString} */
|
geometry = /** @type {ol.geom.LineString} */
|
||||||
(_ol_format_Feature_.transformWithOptions(
|
(FeatureFormat.transformWithOptions(
|
||||||
geometry, true, this.adaptOptions(opt_options)));
|
geometry, true, this.adaptOptions(opt_options)));
|
||||||
var flatCoordinates = geometry.getFlatCoordinates();
|
var flatCoordinates = geometry.getFlatCoordinates();
|
||||||
var stride = geometry.getStride();
|
var stride = geometry.getStride();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/format/TextFeature
|
* @module ol/format/TextFeature
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,10 +16,10 @@ import _ol_format_FormatType_ from '../format/FormatType.js';
|
|||||||
* @extends {ol.format.Feature}
|
* @extends {ol.format.Feature}
|
||||||
*/
|
*/
|
||||||
var _ol_format_TextFeature_ = function() {
|
var _ol_format_TextFeature_ = function() {
|
||||||
_ol_format_Feature_.call(this);
|
FeatureFormat.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_format_TextFeature_, _ol_format_Feature_);
|
inherits(_ol_format_TextFeature_, FeatureFormat);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
@@ -260,7 +260,7 @@ _ol_format_TopoJSON_.readFeatureFromGeometry_ = function(object, arcs,
|
|||||||
}
|
}
|
||||||
var feature = new _ol_Feature_();
|
var feature = new _ol_Feature_();
|
||||||
feature.setGeometry(/** @type {ol.geom.Geometry} */ (
|
feature.setGeometry(/** @type {ol.geom.Geometry} */ (
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, false, opt_options)));
|
FeatureFormat.transformWithOptions(geometry, false, opt_options)));
|
||||||
if (object.id !== undefined) {
|
if (object.id !== undefined) {
|
||||||
feature.setId(object.id);
|
feature.setId(object.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_Feature_ from '../Feature.js';
|
import _ol_Feature_ from '../Feature.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
@@ -331,7 +331,7 @@ _ol_format_WKT_.prototype.readGeometryFromText = function(text, opt_options) {
|
|||||||
var geometry = this.parse_(text);
|
var geometry = this.parse_(text);
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
return (
|
return (
|
||||||
/** @type {ol.geom.Geometry} */ _ol_format_Feature_.transformWithOptions(geometry, false, opt_options)
|
/** @type {ol.geom.Geometry} */ FeatureFormat.transformWithOptions(geometry, false, opt_options)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
@@ -408,7 +408,7 @@ _ol_format_WKT_.prototype.writeGeometry;
|
|||||||
*/
|
*/
|
||||||
_ol_format_WKT_.prototype.writeGeometryText = function(geometry, opt_options) {
|
_ol_format_WKT_.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||||
return _ol_format_WKT_.encode_(/** @type {ol.geom.Geometry} */ (
|
return _ol_format_WKT_.encode_(/** @type {ol.geom.Geometry} */ (
|
||||||
_ol_format_Feature_.transformWithOptions(geometry, true, opt_options)));
|
FeatureFormat.transformWithOptions(geometry, true, opt_options)));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_array_ from '../array.js';
|
import _ol_array_ from '../array.js';
|
||||||
import _ol_format_Feature_ from '../format/Feature.js';
|
import FeatureFormat from '../format/Feature.js';
|
||||||
import _ol_format_FormatType_ from '../format/FormatType.js';
|
import _ol_format_FormatType_ from '../format/FormatType.js';
|
||||||
import _ol_xml_ from '../xml.js';
|
import _ol_xml_ from '../xml.js';
|
||||||
|
|
||||||
@@ -25,10 +25,10 @@ var _ol_format_XMLFeature_ = function() {
|
|||||||
*/
|
*/
|
||||||
this.xmlSerializer_ = new XMLSerializer();
|
this.xmlSerializer_ = new XMLSerializer();
|
||||||
|
|
||||||
_ol_format_Feature_.call(this);
|
FeatureFormat.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_format_XMLFeature_, _ol_format_Feature_);
|
inherits(_ol_format_XMLFeature_, FeatureFormat);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_format_Feature_ from '../../../../src/ol/format/Feature.js';
|
import FeatureFormat from '../../../../src/ol/format/Feature.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
import _ol_format_TopoJSON_ from '../../../../src/ol/format/TopoJSON.js';
|
import _ol_format_TopoJSON_ from '../../../../src/ol/format/TopoJSON.js';
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ describe('ol.format.TopoJSON', function() {
|
|||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
it('creates a new format', function() {
|
it('creates a new format', function() {
|
||||||
expect(format).to.be.a(_ol_format_Feature_);
|
expect(format).to.be.a(FeatureFormat);
|
||||||
expect(format).to.be.a(_ol_format_TopoJSON_);
|
expect(format).to.be.a(_ol_format_TopoJSON_);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user