Rename setFlatCoordinatesInternal to setFlatCoordinates
This commit is contained in:
@@ -575,7 +575,7 @@ Graticule.prototype.getMeridian_ = function(lon, minLat, maxLat, squaredToleranc
|
|||||||
if (!lineString) {
|
if (!lineString) {
|
||||||
lineString = this.meridians_[index] = new LineString(flatCoordinates, GeometryLayout.XY);
|
lineString = this.meridians_[index] = new LineString(flatCoordinates, GeometryLayout.XY);
|
||||||
} else {
|
} else {
|
||||||
lineString.setFlatCoordinatesInternal(GeometryLayout.XY, flatCoordinates);
|
lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
||||||
lineString.changed();
|
lineString.changed();
|
||||||
}
|
}
|
||||||
return lineString;
|
return lineString;
|
||||||
@@ -607,7 +607,7 @@ Graticule.prototype.getParallel_ = function(lat, minLon, maxLon, squaredToleranc
|
|||||||
if (!lineString) {
|
if (!lineString) {
|
||||||
lineString = new LineString(flatCoordinates, GeometryLayout.XY);
|
lineString = new LineString(flatCoordinates, GeometryLayout.XY);
|
||||||
} else {
|
} else {
|
||||||
lineString.setFlatCoordinatesInternal(GeometryLayout.XY, flatCoordinates);
|
lineString.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
|
||||||
lineString.changed();
|
lineString.changed();
|
||||||
}
|
}
|
||||||
return lineString;
|
return lineString;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {deflateCoordinate} from '../geom/flat/deflate.js';
|
|||||||
const Circle = function(center, opt_radius, opt_layout) {
|
const Circle = function(center, opt_radius, opt_layout) {
|
||||||
SimpleGeometry.call(this);
|
SimpleGeometry.call(this);
|
||||||
if (opt_layout !== undefined && opt_radius === undefined) {
|
if (opt_layout !== undefined && opt_radius === undefined) {
|
||||||
this.setFlatCoordinatesInternal(opt_layout, center);
|
this.setFlatCoordinates(opt_layout, center);
|
||||||
} else {
|
} else {
|
||||||
const radius = opt_radius ? opt_radius : 0;
|
const radius = opt_radius ? opt_radius : 0;
|
||||||
this.setCenterAndRadius(center, radius, opt_layout);
|
this.setCenterAndRadius(center, radius, opt_layout);
|
||||||
@@ -173,7 +173,7 @@ Circle.prototype.setCenter = function(center) {
|
|||||||
for (let i = 1; i < stride; ++i) {
|
for (let i = 1; i < stride; ++i) {
|
||||||
flatCoordinates[stride + i] = center[i];
|
flatCoordinates[stride + i] = center[i];
|
||||||
}
|
}
|
||||||
this.setFlatCoordinatesInternal(this.layout, flatCoordinates);
|
this.setFlatCoordinates(this.layout, flatCoordinates);
|
||||||
this.changed();
|
this.changed();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const LineString = function(coordinates, opt_layout) {
|
|||||||
this.maxDeltaRevision_ = -1;
|
this.maxDeltaRevision_ = -1;
|
||||||
|
|
||||||
if (opt_layout !== undefined && !Array.isArray(coordinates[0])) {
|
if (opt_layout !== undefined && !Array.isArray(coordinates[0])) {
|
||||||
this.setFlatCoordinatesInternal(opt_layout, coordinates);
|
this.setFlatCoordinates(opt_layout, coordinates);
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(coordinates, opt_layout);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const LinearRing = function(coordinates, opt_layout) {
|
|||||||
this.maxDeltaRevision_ = -1;
|
this.maxDeltaRevision_ = -1;
|
||||||
|
|
||||||
if (opt_layout !== undefined && !Array.isArray(coordinates[0])) {
|
if (opt_layout !== undefined && !Array.isArray(coordinates[0])) {
|
||||||
this.setFlatCoordinatesInternal(opt_layout, coordinates);
|
this.setFlatCoordinates(opt_layout, coordinates);
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(coordinates, opt_layout);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const MultiLineString = function(coordinates, opt_layout, opt_ends) {
|
|||||||
if (Array.isArray(coordinates[0])) {
|
if (Array.isArray(coordinates[0])) {
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(coordinates, opt_layout);
|
||||||
} else if (opt_layout !== undefined && opt_ends) {
|
} else if (opt_layout !== undefined && opt_ends) {
|
||||||
this.setFlatCoordinatesInternal(opt_layout, coordinates);
|
this.setFlatCoordinates(opt_layout, coordinates);
|
||||||
this.ends_ = opt_ends;
|
this.ends_ = opt_ends;
|
||||||
} else {
|
} else {
|
||||||
let layout = this.getLayout();
|
let layout = this.getLayout();
|
||||||
@@ -67,7 +67,7 @@ const MultiLineString = function(coordinates, opt_layout, opt_ends) {
|
|||||||
extend(flatCoordinates, lineString.getFlatCoordinates());
|
extend(flatCoordinates, lineString.getFlatCoordinates());
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
this.setFlatCoordinates(layout, flatCoordinates);
|
||||||
this.ends_ = ends;
|
this.ends_ = ends;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {squaredDistance as squaredDx} from '../math.js';
|
|||||||
const MultiPoint = function(coordinates, opt_layout) {
|
const MultiPoint = function(coordinates, opt_layout) {
|
||||||
SimpleGeometry.call(this);
|
SimpleGeometry.call(this);
|
||||||
if (opt_layout && !Array.isArray(coordinates[0])) {
|
if (opt_layout && !Array.isArray(coordinates[0])) {
|
||||||
this.setFlatCoordinatesInternal(opt_layout, coordinates);
|
this.setFlatCoordinates(opt_layout, coordinates);
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(coordinates, opt_layout);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const MultiPolygon = function(coordinates, opt_layout, opt_endss) {
|
|||||||
opt_endss = endss;
|
opt_endss = endss;
|
||||||
}
|
}
|
||||||
if (opt_layout !== undefined && opt_endss) {
|
if (opt_layout !== undefined && opt_endss) {
|
||||||
this.setFlatCoordinatesInternal(opt_layout, coordinates);
|
this.setFlatCoordinates(opt_layout, coordinates);
|
||||||
this.endss_ = opt_endss;
|
this.endss_ = opt_endss;
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(coordinates, opt_layout);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ const Polygon = function(coordinates, opt_layout, opt_ends) {
|
|||||||
this.orientedFlatCoordinates_ = null;
|
this.orientedFlatCoordinates_ = null;
|
||||||
|
|
||||||
if (opt_layout !== undefined && opt_ends) {
|
if (opt_layout !== undefined && opt_ends) {
|
||||||
this.setFlatCoordinatesInternal(opt_layout, coordinates);
|
this.setFlatCoordinates(opt_layout, coordinates);
|
||||||
this.ends_ = opt_ends;
|
this.ends_ = opt_ends;
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(coordinates, opt_layout);
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ SimpleGeometry.prototype.getStride = function() {
|
|||||||
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
SimpleGeometry.prototype.setFlatCoordinatesInternal = function(layout, flatCoordinates) {
|
SimpleGeometry.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||||
this.stride = getStrideForLayout(layout);
|
this.stride = getStrideForLayout(layout);
|
||||||
this.layout = layout;
|
this.layout = layout;
|
||||||
this.flatCoordinates = flatCoordinates;
|
this.flatCoordinates = flatCoordinates;
|
||||||
|
|||||||
@@ -741,7 +741,7 @@ Draw.prototype.modifyDrawing_ = function(event) {
|
|||||||
sketchLineGeom = new LineString(ring.getFlatCoordinates(), ring.getLayout());
|
sketchLineGeom = new LineString(ring.getFlatCoordinates(), ring.getLayout());
|
||||||
this.sketchLine_.setGeometry(sketchLineGeom);
|
this.sketchLine_.setGeometry(sketchLineGeom);
|
||||||
} else {
|
} else {
|
||||||
sketchLineGeom.setFlatCoordinatesInternal(
|
sketchLineGeom.setFlatCoordinates(
|
||||||
ring.getLayout(), ring.getFlatCoordinates());
|
ring.getLayout(), ring.getFlatCoordinates());
|
||||||
sketchLineGeom.changed();
|
sketchLineGeom.changed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ describe('ol.geom.Circle', function() {
|
|||||||
describe('#setFlatCoordinates', function() {
|
describe('#setFlatCoordinates', function() {
|
||||||
|
|
||||||
it('sets both center and radius', function() {
|
it('sets both center and radius', function() {
|
||||||
circle.setFlatCoordinatesInternal('XY', [1, 2, 4, 2]);
|
circle.setFlatCoordinates('XY', [1, 2, 4, 2]);
|
||||||
expect(circle.getCenter()).to.eql([1, 2]);
|
expect(circle.getCenter()).to.eql([1, 2]);
|
||||||
expect(circle.getRadius()).to.be(3);
|
expect(circle.getRadius()).to.be(3);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user