rename external methods to API names
This commit is contained in:
@@ -135,7 +135,7 @@ map.on('pointermove', function(evt) {
|
||||
if (evt.dragging) {
|
||||
return;
|
||||
}
|
||||
const coordinate = map.getEventCoordinateExternal(evt.originalEvent);
|
||||
const coordinate = map.getEventCoordinate(evt.originalEvent);
|
||||
displaySnap(coordinate);
|
||||
});
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ raster.on('beforeoperations', function(event) {
|
||||
const data = event.data;
|
||||
data.delta = thresholdControl.value;
|
||||
if (coordinate) {
|
||||
data.pixel = map.getPixelFromCoordinateExternal(coordinate);
|
||||
data.pixel = map.getPixelFromCoordinate(coordinate);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ map.on('pointermove', function(evt) {
|
||||
if (evt.dragging) {
|
||||
return;
|
||||
}
|
||||
const coordinate = map.getEventCoordinateExternal(evt.originalEvent);
|
||||
const coordinate = map.getEventCoordinate(evt.originalEvent);
|
||||
displaySnap(coordinate);
|
||||
});
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ map.on('pointermove', function(evt) {
|
||||
if (evt.dragging) {
|
||||
return;
|
||||
}
|
||||
const coordinate = map.getEventCoordinateExternal(evt.originalEvent);
|
||||
const coordinate = map.getEventCoordinate(evt.originalEvent);
|
||||
displayCountryInfo(coordinate);
|
||||
});
|
||||
|
||||
|
||||
@@ -546,7 +546,7 @@ class PluggableMap extends BaseObject {
|
||||
if (!this.frameState_) {
|
||||
return;
|
||||
}
|
||||
const coordinate = this.getCoordinateFromPixelExternal(pixel);
|
||||
const coordinate = this.getCoordinateFromPixel(pixel);
|
||||
opt_options = opt_options !== undefined ? opt_options :
|
||||
/** @type {AtPixelOptions} */ ({});
|
||||
const hitTolerance = opt_options.hitTolerance !== undefined ?
|
||||
@@ -618,7 +618,7 @@ class PluggableMap extends BaseObject {
|
||||
if (!this.frameState_) {
|
||||
return false;
|
||||
}
|
||||
const coordinate = this.getCoordinateFromPixelExternal(pixel);
|
||||
const coordinate = this.getCoordinateFromPixel(pixel);
|
||||
opt_options = opt_options !== undefined ? opt_options :
|
||||
/** @type {AtPixelOptions} */ ({});
|
||||
const layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;
|
||||
@@ -634,8 +634,8 @@ class PluggableMap extends BaseObject {
|
||||
* @return {import("./coordinate.js").Coordinate} Coordinate.
|
||||
* @api
|
||||
*/
|
||||
getEventCoordinateExternal(event) {
|
||||
return this.getCoordinateFromPixelExternal(this.getEventPixel(event));
|
||||
getEventCoordinate(event) {
|
||||
return this.getCoordinateFromPixel(this.getEventPixel(event));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -701,7 +701,7 @@ class PluggableMap extends BaseObject {
|
||||
* @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position.
|
||||
* @api
|
||||
*/
|
||||
getCoordinateFromPixelExternal(pixel) {
|
||||
getCoordinateFromPixel(pixel) {
|
||||
return toUserCoordinate(this.getCoordinateFromPixelInternal(pixel), this.getView().getProjection());
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ class PluggableMap extends BaseObject {
|
||||
* @return {import("./pixel.js").Pixel} A pixel position in the map viewport.
|
||||
* @api
|
||||
*/
|
||||
getPixelFromCoordinateExternal(coordinate) {
|
||||
getPixelFromCoordinate(coordinate) {
|
||||
const viewCoordinate = fromUserCoordinate(coordinate, this.getView().getProjection());
|
||||
return this.getPixelFromCoordinateInternal(viewCoordinate);
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ class Extent extends PointerInteraction {
|
||||
* @return {import("../extent.js").Extent} Drawn extent in the view projection.
|
||||
* @api
|
||||
*/
|
||||
getExtentExternal() {
|
||||
getExtent() {
|
||||
return toUserExtent(this.getExtentInternal(), this.getMap().getView().getProjection());
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ describe('ol.interaction.Extent', function() {
|
||||
simulateEvent('pointerdrag', 50, 50, false, 0);
|
||||
simulateEvent('pointerup', 50, 50, false, 0);
|
||||
|
||||
expect(interaction.getExtentExternal()).to.eql([-50, -50, 50, 50]);
|
||||
expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
|
||||
});
|
||||
|
||||
it('clicking off extent nulls extent', function() {
|
||||
@@ -108,7 +108,7 @@ describe('ol.interaction.Extent', function() {
|
||||
simulateEvent('pointerdown', -10, -10, false, 0);
|
||||
simulateEvent('pointerup', -10, -10, false, 0);
|
||||
|
||||
expect(interaction.getExtentExternal()).to.equal(null);
|
||||
expect(interaction.getExtent()).to.equal(null);
|
||||
});
|
||||
|
||||
it('clicking on extent does not null extent', function() {
|
||||
@@ -117,7 +117,7 @@ describe('ol.interaction.Extent', function() {
|
||||
simulateEvent('pointerdown', 50, 50, false, 0);
|
||||
simulateEvent('pointerup', 50, 50, false, 0);
|
||||
|
||||
expect(interaction.getExtentExternal()).to.eql([-50, -50, 50, 50]);
|
||||
expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
|
||||
});
|
||||
|
||||
it('snap and drag vertex works', function() {
|
||||
@@ -127,7 +127,7 @@ describe('ol.interaction.Extent', function() {
|
||||
simulateEvent('pointerdrag', -70, -40, false, 0);
|
||||
simulateEvent('pointerup', -70, -40, false, 0);
|
||||
|
||||
expect(interaction.getExtentExternal()).to.eql([-70, -50, -50, -40]);
|
||||
expect(interaction.getExtent()).to.eql([-70, -50, -50, -40]);
|
||||
});
|
||||
|
||||
it('snap and drag edge works', function() {
|
||||
@@ -137,7 +137,7 @@ describe('ol.interaction.Extent', function() {
|
||||
simulateEvent('pointerdrag', 20, -30, false, 0);
|
||||
simulateEvent('pointerup', 20, -30, false, 0);
|
||||
|
||||
expect(interaction.getExtentExternal()).to.eql([-50, -50, 20, 50]);
|
||||
expect(interaction.getExtent()).to.eql([-50, -50, 20, 50]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -779,7 +779,7 @@ describe('ol.Map', function() {
|
||||
|
||||
it('gets coordinates in user projection', function(done) {
|
||||
map.renderSync();
|
||||
const coordinateGeographic = map.getCoordinateFromPixelExternal(screenCenter);
|
||||
const coordinateGeographic = map.getCoordinateFromPixel(screenCenter);
|
||||
expect(coordinateGeographic[0]).to.roughlyEqual(centerGeographic[0], 1e-5);
|
||||
expect(coordinateGeographic[1]).to.roughlyEqual(centerGeographic[1], 1e-5);
|
||||
done();
|
||||
@@ -795,7 +795,7 @@ describe('ol.Map', function() {
|
||||
|
||||
it('gets pixel from coordinates in user projection', function(done) {
|
||||
map.renderSync();
|
||||
const pixel = map.getPixelFromCoordinateExternal(centerGeographic);
|
||||
const pixel = map.getPixelFromCoordinate(centerGeographic);
|
||||
expect(pixel).to.eql(screenCenter);
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user