Rename _ol_geom_Geometry_ to Geometry
This commit is contained in:
@@ -6,7 +6,7 @@ import _ol_events_ from './events.js';
|
||||
import _ol_events_EventType_ from './events/EventType.js';
|
||||
import {inherits} from './index.js';
|
||||
import _ol_Object_ from './Object.js';
|
||||
import _ol_geom_Geometry_ from './geom/Geometry.js';
|
||||
import Geometry from './geom/Geometry.js';
|
||||
import _ol_style_Style_ from './style/Style.js';
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ var _ol_Feature_ = function(opt_geometryOrProperties) {
|
||||
this.handleGeometryChanged_, this);
|
||||
|
||||
if (opt_geometryOrProperties !== undefined) {
|
||||
if (opt_geometryOrProperties instanceof _ol_geom_Geometry_ ||
|
||||
if (opt_geometryOrProperties instanceof Geometry ||
|
||||
!opt_geometryOrProperties) {
|
||||
var geometry = opt_geometryOrProperties;
|
||||
this.setGeometry(geometry);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/format/Feature
|
||||
*/
|
||||
import _ol_geom_Geometry_ from '../geom/Geometry.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import {get as getProjection, equivalent as equivalentProjection, transformExtent} from '../proj.js';
|
||||
|
||||
@@ -184,7 +184,7 @@ _ol_format_Feature_.transformWithOptions = function(
|
||||
var transformed;
|
||||
if (featureProjection && dataProjection &&
|
||||
!equivalentProjection(featureProjection, dataProjection)) {
|
||||
if (geometry instanceof _ol_geom_Geometry_) {
|
||||
if (geometry instanceof Geometry) {
|
||||
transformed = (write ? geometry.clone() : geometry).transform(
|
||||
write ? featureProjection : dataProjection,
|
||||
write ? dataProjection : featureProjection);
|
||||
|
||||
@@ -6,7 +6,7 @@ import {createOrUpdate} from '../extent.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import _ol_geom_Geometry_ from '../geom/Geometry.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import {get as getProjection, transformExtent} from '../proj.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
@@ -254,7 +254,7 @@ _ol_format_GML2_.prototype.writeFeatureElement = function(node, feature, objectS
|
||||
if (value !== null) {
|
||||
keys.push(key);
|
||||
values.push(value);
|
||||
if (key == geometryName || value instanceof _ol_geom_Geometry_) {
|
||||
if (key == geometryName || value instanceof Geometry) {
|
||||
if (!(key in context.serializers[featureNS])) {
|
||||
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
|
||||
this.writeGeometryElement, this);
|
||||
|
||||
@@ -7,7 +7,7 @@ import {createOrUpdate} from '../extent.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import _ol_geom_Geometry_ from '../geom/Geometry.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
@@ -996,7 +996,7 @@ _ol_format_GML3_.prototype.writeFeatureElement = function(node, feature, objectS
|
||||
if (value !== null) {
|
||||
keys.push(key);
|
||||
values.push(value);
|
||||
if (key == geometryName || value instanceof _ol_geom_Geometry_) {
|
||||
if (key == geometryName || value instanceof Geometry) {
|
||||
if (!(key in context.serializers[featureNS])) {
|
||||
context.serializers[featureNS][key] = _ol_xml_.makeChildAppender(
|
||||
this.writeGeometryElement, this);
|
||||
|
||||
@@ -9,7 +9,7 @@ import _ol_format_GMLBase_ from '../format/GMLBase.js';
|
||||
import _ol_format_filter_ from '../format/filter.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import _ol_geom_Geometry_ from '../geom/Geometry.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
import _ol_xml_ from '../xml.js';
|
||||
@@ -490,7 +490,7 @@ _ol_format_WFS_.writeUpdate_ = function(node, feature, objectStack) {
|
||||
var value = feature.get(keys[i]);
|
||||
if (value !== undefined) {
|
||||
var name = keys[i];
|
||||
if (value instanceof _ol_geom_Geometry_) {
|
||||
if (value instanceof Geometry) {
|
||||
name = geometryName;
|
||||
}
|
||||
values.push({name: name, value: value});
|
||||
@@ -522,7 +522,7 @@ _ol_format_WFS_.writeProperty_ = function(node, pair, objectStack) {
|
||||
if (pair.value !== undefined && pair.value !== null) {
|
||||
var value = _ol_xml_.createElementNS(_ol_format_WFS_.WFSNS, 'Value');
|
||||
node.appendChild(value);
|
||||
if (pair.value instanceof _ol_geom_Geometry_) {
|
||||
if (pair.value instanceof Geometry) {
|
||||
if (gmlVersion === 2) {
|
||||
_ol_format_GML2_.prototype.writeGeometryElement(value,
|
||||
pair.value, objectStack);
|
||||
|
||||
@@ -24,7 +24,7 @@ import _ol_transform_ from '../transform.js';
|
||||
* @extends {ol.Object}
|
||||
* @api
|
||||
*/
|
||||
var _ol_geom_Geometry_ = function() {
|
||||
var Geometry = function() {
|
||||
|
||||
_ol_Object_.call(this);
|
||||
|
||||
@@ -66,7 +66,7 @@ var _ol_geom_Geometry_ = function() {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_geom_Geometry_, _ol_Object_);
|
||||
inherits(Geometry, _ol_Object_);
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ inherits(_ol_geom_Geometry_, _ol_Object_);
|
||||
* @abstract
|
||||
* @return {!ol.geom.Geometry} Clone.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.clone = function() {};
|
||||
Geometry.prototype.clone = function() {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -85,7 +85,7 @@ _ol_geom_Geometry_.prototype.clone = function() {};
|
||||
* @param {number} minSquaredDistance Minimum squared distance.
|
||||
* @return {number} Minimum squared distance.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {};
|
||||
Geometry.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -96,7 +96,7 @@ _ol_geom_Geometry_.prototype.closestPointXY = function(x, y, closestPoint, minSq
|
||||
* @return {ol.Coordinate} Closest point.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.getClosestPoint = function(point, opt_closestPoint) {
|
||||
Geometry.prototype.getClosestPoint = function(point, opt_closestPoint) {
|
||||
var closestPoint = opt_closestPoint ? opt_closestPoint : [NaN, NaN];
|
||||
this.closestPointXY(point[0], point[1], closestPoint, Infinity);
|
||||
return closestPoint;
|
||||
@@ -110,7 +110,7 @@ _ol_geom_Geometry_.prototype.getClosestPoint = function(point, opt_closestPoint)
|
||||
* @return {boolean} Contains coordinate.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.intersectsCoordinate = function(coordinate) {
|
||||
Geometry.prototype.intersectsCoordinate = function(coordinate) {
|
||||
return this.containsXY(coordinate[0], coordinate[1]);
|
||||
};
|
||||
|
||||
@@ -121,7 +121,7 @@ _ol_geom_Geometry_.prototype.intersectsCoordinate = function(coordinate) {
|
||||
* @protected
|
||||
* @return {ol.Extent} extent Extent.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.computeExtent = function(extent) {};
|
||||
Geometry.prototype.computeExtent = function(extent) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -129,7 +129,7 @@ _ol_geom_Geometry_.prototype.computeExtent = function(extent) {};
|
||||
* @param {number} y Y.
|
||||
* @return {boolean} Contains (x, y).
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.containsXY = _ol_functions_.FALSE;
|
||||
Geometry.prototype.containsXY = _ol_functions_.FALSE;
|
||||
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ _ol_geom_Geometry_.prototype.containsXY = _ol_functions_.FALSE;
|
||||
* @return {ol.Extent} extent Extent.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.getExtent = function(opt_extent) {
|
||||
Geometry.prototype.getExtent = function(opt_extent) {
|
||||
if (this.extentRevision_ != this.getRevision()) {
|
||||
this.extent_ = this.computeExtent(this.extent_);
|
||||
this.extentRevision_ = this.getRevision();
|
||||
@@ -155,7 +155,7 @@ _ol_geom_Geometry_.prototype.getExtent = function(opt_extent) {
|
||||
* @param {ol.Coordinate} anchor The rotation center.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.rotate = function(angle, anchor) {};
|
||||
Geometry.prototype.rotate = function(angle, anchor) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -169,7 +169,7 @@ _ol_geom_Geometry_.prototype.rotate = function(angle, anchor) {};
|
||||
* of the geometry extent).
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.scale = function(sx, opt_sy, opt_anchor) {};
|
||||
Geometry.prototype.scale = function(sx, opt_sy, opt_anchor) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -184,7 +184,7 @@ _ol_geom_Geometry_.prototype.scale = function(sx, opt_sy, opt_anchor) {};
|
||||
* geometry.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.simplify = function(tolerance) {
|
||||
Geometry.prototype.simplify = function(tolerance) {
|
||||
return this.getSimplifiedGeometry(tolerance * tolerance);
|
||||
};
|
||||
|
||||
@@ -197,7 +197,7 @@ _ol_geom_Geometry_.prototype.simplify = function(tolerance) {
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {ol.geom.Geometry} Simplified geometry.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.getSimplifiedGeometry = function(squaredTolerance) {};
|
||||
Geometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -205,7 +205,7 @@ _ol_geom_Geometry_.prototype.getSimplifiedGeometry = function(squaredTolerance)
|
||||
* @abstract
|
||||
* @return {ol.geom.GeometryType} Geometry type.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.getType = function() {};
|
||||
Geometry.prototype.getType = function() {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -216,7 +216,7 @@ _ol_geom_Geometry_.prototype.getType = function() {};
|
||||
* @abstract
|
||||
* @param {ol.TransformFunction} transformFn Transform.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.applyTransform = function(transformFn) {};
|
||||
Geometry.prototype.applyTransform = function(transformFn) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -225,7 +225,7 @@ _ol_geom_Geometry_.prototype.applyTransform = function(transformFn) {};
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} `true` if the geometry and the extent intersect.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.intersectsExtent = function(extent) {};
|
||||
Geometry.prototype.intersectsExtent = function(extent) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -235,7 +235,7 @@ _ol_geom_Geometry_.prototype.intersectsExtent = function(extent) {};
|
||||
* @param {number} deltaX Delta X.
|
||||
* @param {number} deltaY Delta Y.
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.translate = function(deltaX, deltaY) {};
|
||||
Geometry.prototype.translate = function(deltaX, deltaY) {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -253,7 +253,7 @@ _ol_geom_Geometry_.prototype.translate = function(deltaX, deltaY) {};
|
||||
* modified in place.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.transform = function(source, destination) {
|
||||
Geometry.prototype.transform = function(source, destination) {
|
||||
var tmpTransform = this.tmpTransform_;
|
||||
source = getProjection(source);
|
||||
var transformFn = source.getUnits() == _ol_proj_Units_.TILE_PIXELS ?
|
||||
@@ -273,4 +273,4 @@ _ol_geom_Geometry_.prototype.transform = function(source, destination) {
|
||||
this.applyTransform(transformFn);
|
||||
return this;
|
||||
};
|
||||
export default _ol_geom_Geometry_;
|
||||
export default Geometry;
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
import _ol_events_EventType_ from '../events/EventType.js';
|
||||
import {createOrUpdateEmpty, closestSquaredDistanceXY, extend, getCenter} from '../extent.js';
|
||||
import _ol_geom_Geometry_ from '../geom/Geometry.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
|
||||
@@ -20,7 +20,7 @@ import _ol_obj_ from '../obj.js';
|
||||
*/
|
||||
var _ol_geom_GeometryCollection_ = function(opt_geometries) {
|
||||
|
||||
_ol_geom_Geometry_.call(this);
|
||||
Geometry.call(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -31,7 +31,7 @@ var _ol_geom_GeometryCollection_ = function(opt_geometries) {
|
||||
this.listenGeometriesChange_();
|
||||
};
|
||||
|
||||
inherits(_ol_geom_GeometryCollection_, _ol_geom_Geometry_);
|
||||
inherits(_ol_geom_GeometryCollection_, Geometry);
|
||||
|
||||
|
||||
/**
|
||||
@@ -321,6 +321,6 @@ _ol_geom_GeometryCollection_.prototype.translate = function(deltaX, deltaY) {
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.disposeInternal = function() {
|
||||
this.unlistenGeometriesChange_();
|
||||
_ol_geom_Geometry_.prototype.disposeInternal.call(this);
|
||||
Geometry.prototype.disposeInternal.call(this);
|
||||
};
|
||||
export default _ol_geom_GeometryCollection_;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_functions_ from '../functions.js';
|
||||
import {createOrUpdateFromFlatCoordinates, getCenter} from '../extent.js';
|
||||
import _ol_geom_Geometry_ from '../geom/Geometry.js';
|
||||
import Geometry from '../geom/Geometry.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_flat_transform_ from '../geom/flat/transform.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
@@ -21,7 +21,7 @@ import _ol_obj_ from '../obj.js';
|
||||
*/
|
||||
var _ol_geom_SimpleGeometry_ = function() {
|
||||
|
||||
_ol_geom_Geometry_.call(this);
|
||||
Geometry.call(this);
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -43,7 +43,7 @@ var _ol_geom_SimpleGeometry_ = function() {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_geom_SimpleGeometry_, _ol_geom_Geometry_);
|
||||
inherits(_ol_geom_SimpleGeometry_, Geometry);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_geom_Geometry_ from '../../../../src/ol/geom/Geometry.js';
|
||||
import Geometry from '../../../../src/ol/geom/Geometry.js';
|
||||
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
@@ -22,7 +22,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
|
||||
it('creates a geometry collection from an array of geometries', function() {
|
||||
expect(multi).to.be.a(_ol_geom_GeometryCollection_);
|
||||
expect(multi).to.be.a(_ol_geom_Geometry_);
|
||||
expect(multi).to.be.a(Geometry);
|
||||
});
|
||||
|
||||
it('fires a change event when one of its component changes',
|
||||
|
||||
Reference in New Issue
Block a user