Rename _ol_geom_Point_ to Point

This commit is contained in:
Tim Schaub
2017-12-14 08:49:10 -07:00
parent 75c5a8b246
commit eadec38ae2
76 changed files with 365 additions and 365 deletions

View File

@@ -5,7 +5,7 @@ import _ol_coordinate_ from './coordinate.js';
import {intersects, getCenter} from './extent.js';
import _ol_geom_GeometryLayout_ from './geom/GeometryLayout.js';
import _ol_geom_LineString_ from './geom/LineString.js';
import _ol_geom_Point_ from './geom/Point.js';
import Point from './geom/Point.js';
import _ol_geom_flat_geodesic_ from './geom/flat/geodesic.js';
import _ol_math_ from './math.js';
import {get as getProjection, equivalent as equivalentProjection, getTransform, transformExtent} from './proj.js';
@@ -283,7 +283,7 @@ _ol_Graticule_.prototype.getMeridianPoint_ = function(lineString, extent, index)
clampedBottom, clampedTop);
var coordinate = [flatCoordinates[0], lat];
var point = this.meridiansLabels_[index] !== undefined ?
this.meridiansLabels_[index].geom : new _ol_geom_Point_(null);
this.meridiansLabels_[index].geom : new Point(null);
point.setCoordinates(coordinate);
return point;
};
@@ -332,7 +332,7 @@ _ol_Graticule_.prototype.getParallelPoint_ = function(lineString, extent, index)
clampedLeft, clampedRight);
var coordinate = [lon, flatCoordinates[1]];
var point = this.parallelsLabels_[index] !== undefined ?
this.parallelsLabels_[index].geom : new _ol_geom_Point_(null);
this.parallelsLabels_[index].geom : new Point(null);
point.setCoordinates(coordinate);
return point;
};

View File

@@ -14,7 +14,7 @@ import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
@@ -152,16 +152,16 @@ _ol_format_EsriJSON_.convertRings_ = function(rings, layout) {
_ol_format_EsriJSON_.readPointGeometry_ = function(object) {
var point;
if (object.m !== undefined && object.z !== undefined) {
point = new _ol_geom_Point_([object.x, object.y, object.z, object.m],
point = new Point([object.x, object.y, object.z, object.m],
_ol_geom_GeometryLayout_.XYZM);
} else if (object.z !== undefined) {
point = new _ol_geom_Point_([object.x, object.y, object.z],
point = new Point([object.x, object.y, object.z],
_ol_geom_GeometryLayout_.XYZ);
} else if (object.m !== undefined) {
point = new _ol_geom_Point_([object.x, object.y, object.m],
point = new Point([object.x, object.y, object.m],
_ol_geom_GeometryLayout_.XYM);
} else {
point = new _ol_geom_Point_([object.x, object.y]);
point = new Point([object.x, object.y]);
}
return point;
};

View File

@@ -15,7 +15,7 @@ import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_obj_ from '../obj.js';
import {get as getProjection} from '../proj.js';
@@ -264,7 +264,7 @@ _ol_format_GMLBase_.prototype.readPoint = function(node, objectStack) {
var flatCoordinates =
this.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var point = new _ol_geom_Point_(null);
var point = new Point(null);
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
return point;
}

View File

@@ -10,7 +10,7 @@ import _ol_format_XSD_ from '../format/XSD.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import {get as getProjection} from '../proj.js';
import _ol_xml_ from '../xml.js';
@@ -298,7 +298,7 @@ _ol_format_GPX_.readWpt_ = function(node, objectStack) {
var layoutOptions = /** @type {ol.LayoutOptions} */ ({});
var coordinates = _ol_format_GPX_.appendCoordinate_([], layoutOptions, node, values);
var layout = _ol_format_GPX_.applyLayoutOptions_(layoutOptions, coordinates);
var geometry = new _ol_geom_Point_(coordinates, layout);
var geometry = new Point(coordinates, layout);
_ol_format_Feature_.transformWithOptions(geometry, false, options);
var feature = new _ol_Feature_(geometry);
feature.setProperties(values);

View File

@@ -14,7 +14,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_obj_ from '../obj.js';
import {get as getProjection} from '../proj.js';
@@ -109,7 +109,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
* @return {ol.geom.Point} Point.
*/
_ol_format_GeoJSON_.readPointGeometry_ = function(object) {
return new _ol_geom_Point_(object.coordinates);
return new Point(object.coordinates);
};

View File

@@ -21,7 +21,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_math_ from '../math.js';
import {get as getProjection} from '../proj.js';
@@ -972,7 +972,7 @@ _ol_format_KML_.readPoint_ = function(node, objectStack) {
var flatCoordinates =
_ol_format_KML_.readFlatCoordinatesFromNode_(node, objectStack);
if (flatCoordinates) {
var point = new _ol_geom_Point_(null);
var point = new Point(null);
point.setFlatCoordinates(_ol_geom_GeometryLayout_.XYZ, flatCoordinates);
point.setProperties(properties);
return point;

View File

@@ -14,7 +14,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
import _ol_proj_Projection_ from '../proj/Projection.js';
@@ -310,7 +310,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
geom = new _ol_geom_Polygon_(null);
}
} else {
geom = geometryType === _ol_geom_GeometryType_.POINT ? new _ol_geom_Point_(null) :
geom = geometryType === _ol_geom_GeometryType_.POINT ? new Point(null) :
geometryType === _ol_geom_GeometryType_.LINE_STRING ? new _ol_geom_LineString_(null) :
geometryType === _ol_geom_GeometryType_.POLYGON ? new _ol_geom_Polygon_(null) :
geometryType === _ol_geom_GeometryType_.MULTI_POINT ? new _ol_geom_MultiPoint_ (null) :

View File

@@ -9,7 +9,7 @@ import _ol_format_Feature_ from '../format/Feature.js';
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_obj_ from '../obj.js';
import {get as getProjection} from '../proj.js';
@@ -56,7 +56,7 @@ _ol_format_OSMXML_.readNode_ = function(node, objectStack) {
tags: {}
}, _ol_format_OSMXML_.NODE_PARSERS_, node, objectStack);
if (!_ol_obj_.isEmpty(values.tags)) {
var geometry = new _ol_geom_Point_(coordinates);
var geometry = new Point(coordinates);
_ol_format_Feature_.transformWithOptions(geometry, false, options);
var feature = new _ol_Feature_(geometry);
feature.setId(id);

View File

@@ -9,7 +9,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import {get as getProjection} from '../proj.js';
@@ -104,7 +104,7 @@ _ol_format_TopoJSON_.readPointGeometry_ = function(object, scale, translate) {
if (scale && translate) {
_ol_format_TopoJSON_.transformVertex_(coordinates, scale, translate);
}
return new _ol_geom_Point_(coordinates);
return new Point(coordinates);
};

View File

@@ -12,7 +12,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
@@ -918,7 +918,7 @@ _ol_format_WKT_.Parser.prototype.formatErrorMessage_ = function() {
* @private
*/
_ol_format_WKT_.Parser.GeometryConstructor_ = {
'POINT': _ol_geom_Point_,
'POINT': Point,
'LINESTRING': _ol_geom_LineString_,
'POLYGON': _ol_geom_Polygon_,
'MULTIPOINT': _ol_geom_MultiPoint_,

View File

@@ -6,7 +6,7 @@ import _ol_array_ from '../array.js';
import {closestSquaredDistanceXY, containsXY} from '../extent.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
import _ol_geom_flat_inflate_ from '../geom/flat/inflate.js';
@@ -107,7 +107,7 @@ _ol_geom_MultiPoint_.prototype.getPoint = function(index) {
if (index < 0 || n <= index) {
return null;
}
var point = new _ol_geom_Point_(null);
var point = new Point(null);
point.setFlatCoordinates(this.layout, this.flatCoordinates.slice(
index * this.stride, (index + 1) * this.stride));
return point;
@@ -127,7 +127,7 @@ _ol_geom_MultiPoint_.prototype.getPoints = function() {
var points = [];
var i, ii;
for (i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
var point = new _ol_geom_Point_(null);
var point = new Point(null);
point.setFlatCoordinates(layout, flatCoordinates.slice(i, i + stride));
points.push(point);
}

View File

@@ -19,12 +19,12 @@ import _ol_math_ from '../math.js';
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
* @api
*/
var _ol_geom_Point_ = function(coordinates, opt_layout) {
var Point = function(coordinates, opt_layout) {
_ol_geom_SimpleGeometry_.call(this);
this.setCoordinates(coordinates, opt_layout);
};
inherits(_ol_geom_Point_, _ol_geom_SimpleGeometry_);
inherits(Point, _ol_geom_SimpleGeometry_);
/**
@@ -33,8 +33,8 @@ inherits(_ol_geom_Point_, _ol_geom_SimpleGeometry_);
* @override
* @api
*/
_ol_geom_Point_.prototype.clone = function() {
var point = new _ol_geom_Point_(null);
Point.prototype.clone = function() {
var point = new Point(null);
point.setFlatCoordinates(this.layout, this.flatCoordinates.slice());
return point;
};
@@ -43,7 +43,7 @@ _ol_geom_Point_.prototype.clone = function() {
/**
* @inheritDoc
*/
_ol_geom_Point_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
Point.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
var flatCoordinates = this.flatCoordinates;
var squaredDistance = _ol_math_.squaredDistance(
x, y, flatCoordinates[0], flatCoordinates[1]);
@@ -67,7 +67,7 @@ _ol_geom_Point_.prototype.closestPointXY = function(x, y, closestPoint, minSquar
* @override
* @api
*/
_ol_geom_Point_.prototype.getCoordinates = function() {
Point.prototype.getCoordinates = function() {
return !this.flatCoordinates ? [] : this.flatCoordinates.slice();
};
@@ -75,7 +75,7 @@ _ol_geom_Point_.prototype.getCoordinates = function() {
/**
* @inheritDoc
*/
_ol_geom_Point_.prototype.computeExtent = function(extent) {
Point.prototype.computeExtent = function(extent) {
return createOrUpdateFromCoordinate(this.flatCoordinates, extent);
};
@@ -84,7 +84,7 @@ _ol_geom_Point_.prototype.computeExtent = function(extent) {
* @inheritDoc
* @api
*/
_ol_geom_Point_.prototype.getType = function() {
Point.prototype.getType = function() {
return _ol_geom_GeometryType_.POINT;
};
@@ -93,7 +93,7 @@ _ol_geom_Point_.prototype.getType = function() {
* @inheritDoc
* @api
*/
_ol_geom_Point_.prototype.intersectsExtent = function(extent) {
Point.prototype.intersectsExtent = function(extent) {
return containsXY(extent, this.flatCoordinates[0], this.flatCoordinates[1]);
};
@@ -102,7 +102,7 @@ _ol_geom_Point_.prototype.intersectsExtent = function(extent) {
* @inheritDoc
* @api
*/
_ol_geom_Point_.prototype.setCoordinates = function(coordinates, opt_layout) {
Point.prototype.setCoordinates = function(coordinates, opt_layout) {
if (!coordinates) {
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null);
} else {
@@ -121,8 +121,8 @@ _ol_geom_Point_.prototype.setCoordinates = function(coordinates, opt_layout) {
* @param {ol.geom.GeometryLayout} layout Layout.
* @param {Array.<number>} flatCoordinates Flat coordinates.
*/
_ol_geom_Point_.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
Point.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
this.setFlatCoordinatesInternal(layout, flatCoordinates);
this.changed();
};
export default _ol_geom_Point_;
export default Point;

View File

@@ -7,7 +7,7 @@ import {closestSquaredDistanceXY, getCenter} from '../extent.js';
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
import _ol_geom_flat_area_ from '../geom/flat/area.js';
import _ol_geom_flat_closest_ from '../geom/flat/closest.js';
@@ -215,7 +215,7 @@ _ol_geom_Polygon_.prototype.getFlatInteriorPoint = function() {
* @api
*/
_ol_geom_Polygon_.prototype.getInteriorPoint = function() {
return new _ol_geom_Point_(this.getFlatInteriorPoint(), _ol_geom_GeometryLayout_.XYM);
return new Point(this.getFlatInteriorPoint(), _ol_geom_GeometryLayout_.XYM);
};

View File

@@ -17,7 +17,7 @@ import _ol_geom_LineString_ from '../geom/LineString.js';
import _ol_geom_MultiLineString_ from '../geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_interaction_DrawEventType_ from '../interaction/DrawEventType.js';
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
@@ -152,7 +152,7 @@ var _ol_interaction_Draw_ = function(options) {
var Constructor;
var mode = this.mode_;
if (mode === _ol_interaction_Draw_.Mode_.POINT) {
Constructor = _ol_geom_Point_;
Constructor = Point;
} else if (mode === _ol_interaction_Draw_.Mode_.LINE_STRING) {
Constructor = _ol_geom_LineString_;
} else if (mode === _ol_interaction_Draw_.Mode_.POLYGON) {
@@ -481,7 +481,7 @@ _ol_interaction_Draw_.prototype.atFinish_ = function(event) {
_ol_interaction_Draw_.prototype.createOrUpdateSketchPoint_ = function(event) {
var coordinates = event.coordinate.slice();
if (!this.sketchPoint_) {
this.sketchPoint_ = new _ol_Feature_(new _ol_geom_Point_(coordinates));
this.sketchPoint_ = new _ol_Feature_(new Point(coordinates));
this.updateSketchFeatures_();
} else {
var sketchPointGeom = /** @type {ol.geom.Point} */ (this.sketchPoint_.getGeometry());

View File

@@ -9,7 +9,7 @@ import _ol_coordinate_ from '../coordinate.js';
import _ol_events_Event_ from '../events/Event.js';
import {boundingExtent, getArea} from '../extent.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_geom_Polygon_ from '../geom/Polygon.js';
import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js';
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
@@ -399,7 +399,7 @@ _ol_interaction_Extent_.prototype.createOrUpdateExtentFeature_ = function(extent
_ol_interaction_Extent_.prototype.createOrUpdatePointerFeature_ = function(vertex) {
var vertexFeature = this.vertexFeature_;
if (!vertexFeature) {
vertexFeature = new _ol_Feature_(new _ol_geom_Point_(vertex));
vertexFeature = new _ol_Feature_(new Point(vertex));
this.vertexFeature_ = vertexFeature;
this.vertexOverlay_.getSource().addFeature(vertexFeature);
} else {

View File

@@ -15,7 +15,7 @@ import _ol_events_EventType_ from '../events/EventType.js';
import _ol_events_condition_ from '../events/condition.js';
import {boundingExtent, buffer, createOrUpdateFromCoordinate} from '../extent.js';
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js';
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
import _ol_layer_Vector_ from '../layer/Vector.js';
@@ -579,7 +579,7 @@ _ol_interaction_Modify_.prototype.writeGeometryCollectionGeometry_ = function(fe
_ol_interaction_Modify_.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
var vertexFeature = this.vertexFeature_;
if (!vertexFeature) {
vertexFeature = new _ol_Feature_(new _ol_geom_Point_(coordinates));
vertexFeature = new _ol_Feature_(new Point(coordinates));
this.vertexFeature_ = vertexFeature;
this.overlay_.getSource().addFeature(vertexFeature);
} else {

View File

@@ -8,7 +8,7 @@ import _ol_Feature_ from '../Feature.js';
import _ol_coordinate_ from '../coordinate.js';
import _ol_events_EventType_ from '../events/EventType.js';
import {buffer, createEmpty, createOrUpdateFromCoordinate} from '../extent.js';
import _ol_geom_Point_ from '../geom/Point.js';
import Point from '../geom/Point.js';
import _ol_source_Vector_ from '../source/Vector.js';
/**
@@ -56,7 +56,7 @@ var _ol_source_Cluster_ = function(options) {
*/
this.geometryFunction = options.geometryFunction || function(feature) {
var geometry = /** @type {ol.geom.Point} */ (feature.getGeometry());
_ol_asserts_.assert(geometry instanceof _ol_geom_Point_,
_ol_asserts_.assert(geometry instanceof Point,
10); // The default `geometryFunction` can only handle `ol.geom.Point` geometries
return geometry;
};
@@ -192,7 +192,7 @@ _ol_source_Cluster_.prototype.createCluster = function(features) {
}
_ol_coordinate_.scale(centroid, 1 / features.length);
var cluster = new _ol_Feature_(new _ol_geom_Point_(centroid));
var cluster = new _ol_Feature_(new Point(centroid));
cluster.set('features', features);
return cluster;
};