Enforces spacing around commas
This commit is contained in:
@@ -137,7 +137,7 @@ describe('ol.control.ScaleLine', function() {
|
||||
expect(renderSpy.callCount).to.be(2);
|
||||
done();
|
||||
});
|
||||
map.getView().setCenter([1,1]);
|
||||
map.getView().setCenter([1, 1]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
expect(feature).to.be.an(ol.Feature);
|
||||
var geometry = feature.getGeometry();
|
||||
expect(geometry).to.be.an(ol.geom.MultiPoint);
|
||||
expect(geometry.getCoordinates()).to.eql([[102.0, 0.0] , [103.0, 1.0]]);
|
||||
expect(geometry.getCoordinates()).to.eql([[102.0, 0.0], [103.0, 1.0]]);
|
||||
expect(feature.get('prop0')).to.be('value0');
|
||||
});
|
||||
|
||||
@@ -874,7 +874,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
|
||||
it('encodes multipoint', function() {
|
||||
var multipoint = new ol.geom.MultiPoint([[102.0, 0.0] , [103.0, 1.0]]);
|
||||
var multipoint = new ol.geom.MultiPoint([[102.0, 0.0], [103.0, 1.0]]);
|
||||
var esrijson = format.writeGeometry(multipoint);
|
||||
expect(multipoint.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
|
||||
@@ -809,7 +809,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
});
|
||||
|
||||
it('truncates transformed point with decimals option', function() {
|
||||
var point = new ol.geom.Point([2, 3]).transform('EPSG:4326','EPSG:3857');
|
||||
var point = new ol.geom.Point([2, 3]).transform('EPSG:4326', 'EPSG:3857');
|
||||
var geojson = format.writeGeometry(point, {
|
||||
featureProjection: 'EPSG:3857',
|
||||
decimals: 2
|
||||
|
||||
@@ -1175,9 +1175,9 @@ describe('ol.format.KML', function() {
|
||||
|
||||
it('can write GeometryCollection geometries', function() {
|
||||
var collection = new ol.geom.GeometryCollection([
|
||||
new ol.geom.Point([1,2]),
|
||||
new ol.geom.LineString([[1,2],[3,4]]),
|
||||
new ol.geom.Polygon([[[1,2],[3,4],[3,2],[1,2]]])
|
||||
new ol.geom.Point([1, 2]),
|
||||
new ol.geom.LineString([[1, 2], [3, 4]]),
|
||||
new ol.geom.Polygon([[[1, 2], [3, 4], [3, 2], [1, 2]]])
|
||||
]);
|
||||
var features = [new ol.Feature(collection)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
@@ -3255,7 +3255,7 @@ describe('ol.format.KML', function() {
|
||||
expect(nl[0].maxLodPixels).to.be(-1);
|
||||
expect(nl[0].minFadeExtent).to.be(0);
|
||||
expect(nl[0].maxFadeExtent).to.be(0);
|
||||
expect(nl[1].extent).to.eql([0,0,180,90]);
|
||||
expect(nl[1].extent).to.eql([0, 0, 180, 90]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -604,7 +604,7 @@ describe('ol.format.WKT', function() {
|
||||
expect(polygons[0].getLinearRings().length).to.eql(1);
|
||||
expect(polygons[1].getLinearRings().length).to.eql(2);
|
||||
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
[[40, 40 , 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]);
|
||||
[[40, 40, 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]);
|
||||
expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
[[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]);
|
||||
expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql(
|
||||
@@ -644,7 +644,7 @@ describe('ol.format.WKT', function() {
|
||||
expect(polygons[0].getLinearRings().length).to.eql(1);
|
||||
expect(polygons[1].getLinearRings().length).to.eql(2);
|
||||
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
[[40, 40 , 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]);
|
||||
[[40, 40, 1], [45, 30, 2], [20, 45, 3], [40, 40, 1]]);
|
||||
expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
[[20, 35, 1], [45, 20, 2], [30, 5, 3], [10, 10, 4], [10, 30, 5], [20, 35, 1]]);
|
||||
expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql(
|
||||
@@ -684,7 +684,7 @@ describe('ol.format.WKT', function() {
|
||||
expect(polygons[0].getLinearRings().length).to.eql(1);
|
||||
expect(polygons[1].getLinearRings().length).to.eql(2);
|
||||
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
[[40, 40 , 1, 0.1], [45, 30, 2, 0.1], [20, 45, 3, 0.1], [40, 40, 1, 0.1]]);
|
||||
[[40, 40, 1, 0.1], [45, 30, 2, 0.1], [20, 45, 3, 0.1], [40, 40, 1, 0.1]]);
|
||||
expect(polygons[1].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
[[20, 35, 1, 0.1], [45, 20, 2, 0.1], [30, 5, 3, 0.1], [10, 10, 4, 0.1], [10, 30, 5, 0.1], [20, 35, 1, 0.1]]);
|
||||
expect(polygons[1].getLinearRings()[1].getCoordinates()).to.eql(
|
||||
|
||||
@@ -8,7 +8,7 @@ describe('getUid()', function() {
|
||||
});
|
||||
|
||||
it('generates a strictly increasing sequence', function() {
|
||||
var a = {} , b = {}, c = {};
|
||||
var a = {}, b = {}, c = {};
|
||||
ol.getUid(a);
|
||||
ol.getUid(c);
|
||||
ol.getUid(b);
|
||||
|
||||
@@ -407,7 +407,7 @@ describe('ol.interaction.Draw', function() {
|
||||
source: source,
|
||||
type: 'LineString',
|
||||
finishCondition: function(event) {
|
||||
if (ol.array.equals(event.coordinate,[30,-20])) {
|
||||
if (ol.array.equals(event.coordinate, [30, -20])) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -74,17 +74,17 @@ describe('ol.interaction.Extent', function() {
|
||||
}
|
||||
describe('snap to vertex', function() {
|
||||
it('snap to vertex works', function() {
|
||||
interaction.setExtent([-50,-50,50,50]);
|
||||
interaction.setExtent([-50, -50, 50, 50]);
|
||||
|
||||
expect(interaction.snapToVertex_([230,40], map)).to.eql([50,50]);
|
||||
expect(interaction.snapToVertex_([231,41], map)).to.eql([50,50]);
|
||||
expect(interaction.snapToVertex_([230, 40], map)).to.eql([50, 50]);
|
||||
expect(interaction.snapToVertex_([231, 41], map)).to.eql([50, 50]);
|
||||
});
|
||||
it('snap to edge works', function() {
|
||||
interaction.setExtent([-50,-50,50,50]);
|
||||
interaction.setExtent([-50, -50, 50, 50]);
|
||||
|
||||
expect(interaction.snapToVertex_([230,90], map)).to.eql([50,0]);
|
||||
expect(interaction.snapToVertex_([230,89], map)).to.eql([50,1]);
|
||||
expect(interaction.snapToVertex_([231,90], map)).to.eql([50,0]);
|
||||
expect(interaction.snapToVertex_([230, 90], map)).to.eql([50, 0]);
|
||||
expect(interaction.snapToVertex_([230, 89], map)).to.eql([50, 1]);
|
||||
expect(interaction.snapToVertex_([231, 90], map)).to.eql([50, 0]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -95,11 +95,11 @@ describe('ol.interaction.Extent', function() {
|
||||
simulateEvent('pointerdrag', 50, 50, false, 0);
|
||||
simulateEvent('pointerup', 50, 50, false, 0);
|
||||
|
||||
expect(interaction.getExtent()).to.eql([-50,-50,50,50]);
|
||||
expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
|
||||
});
|
||||
|
||||
it('clicking off extent nulls extent', function() {
|
||||
interaction.setExtent([-50,-50,50,50]);
|
||||
interaction.setExtent([-50, -50, 50, 50]);
|
||||
|
||||
simulateEvent('pointerdown', -10, -10, false, 0);
|
||||
simulateEvent('pointerup', -10, -10, false, 0);
|
||||
@@ -108,32 +108,32 @@ describe('ol.interaction.Extent', function() {
|
||||
});
|
||||
|
||||
it('clicking on extent does not null extent', function() {
|
||||
interaction.setExtent([-50,-50,50,50]);
|
||||
interaction.setExtent([-50, -50, 50, 50]);
|
||||
|
||||
simulateEvent('pointerdown', 50, 50, false, 0);
|
||||
simulateEvent('pointerup', 50, 50, false, 0);
|
||||
|
||||
expect(interaction.getExtent()).to.eql([-50,-50,50,50]);
|
||||
expect(interaction.getExtent()).to.eql([-50, -50, 50, 50]);
|
||||
});
|
||||
|
||||
it('snap and drag vertex works', function() {
|
||||
interaction.setExtent([-50,-50,50,50]);
|
||||
interaction.setExtent([-50, -50, 50, 50]);
|
||||
|
||||
simulateEvent('pointerdown', 51, 49, false, 0);
|
||||
simulateEvent('pointerdrag', -70, -40, false, 0);
|
||||
simulateEvent('pointerup', -70, -40, false, 0);
|
||||
|
||||
expect(interaction.getExtent()).to.eql([-70,-50,-50,-40]);
|
||||
expect(interaction.getExtent()).to.eql([-70, -50, -50, -40]);
|
||||
});
|
||||
|
||||
it('snap and drag edge works', function() {
|
||||
interaction.setExtent([-50,-50,50,50]);
|
||||
interaction.setExtent([-50, -50, 50, 50]);
|
||||
|
||||
simulateEvent('pointerdown', 51, 5, false, 0);
|
||||
simulateEvent('pointerdrag', 20, -30, false, 0);
|
||||
simulateEvent('pointerup', 20, -30, false, 0);
|
||||
|
||||
expect(interaction.getExtent()).to.eql([-50,-50,20,50]);
|
||||
expect(interaction.getExtent()).to.eql([-50, -50, 20, 50]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -246,7 +246,7 @@ describe('ol.render.canvas.Immediate', function() {
|
||||
[-80.899323, 29.061249000000004, 0], // lineTo()
|
||||
[-80.862663, 28.991361999999995, 0], // lineTo()
|
||||
[-80.736061, 28.788576000000006, 0] // closePath()
|
||||
]],[[
|
||||
]], [[
|
||||
// second polygon
|
||||
[-82.102127, 26.585724, 0], // moveTo()
|
||||
[-82.067139, 26.497208, 0], // lineTo()
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('ol.render.webgl.CircleReplay', function() {
|
||||
|
||||
describe('#drawCircle', function() {
|
||||
it('sets the buffer data', function() {
|
||||
var circle = new ol.geom.Circle([0,0], 5000);
|
||||
var circle = new ol.geom.Circle([0, 0], 5000);
|
||||
|
||||
replay.setFillStrokeStyle(fillStyle, strokeStyle);
|
||||
replay.drawCircle(circle, null);
|
||||
@@ -62,7 +62,7 @@ describe('ol.render.webgl.CircleReplay', function() {
|
||||
});
|
||||
|
||||
it('does not draw if radius is zero', function() {
|
||||
var circle = new ol.geom.Circle([0,0], 0);
|
||||
var circle = new ol.geom.Circle([0, 0], 0);
|
||||
|
||||
replay.drawCircle(circle, null);
|
||||
expect(replay.vertices).to.have.length(0);
|
||||
@@ -72,7 +72,7 @@ describe('ol.render.webgl.CircleReplay', function() {
|
||||
});
|
||||
|
||||
it('resets state and removes style if it belongs to a zero radius circle', function() {
|
||||
var circle = new ol.geom.Circle([0,0], 0);
|
||||
var circle = new ol.geom.Circle([0, 0], 0);
|
||||
|
||||
replay.setFillStrokeStyle(fillStyle, strokeStyle);
|
||||
replay.setFillStrokeStyle(null, strokeStyle);
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('ol.style.Style', function() {
|
||||
|
||||
it('copies all values', function() {
|
||||
var original = new ol.style.Style({
|
||||
geometry: new ol.geom.Point([0,0,0]),
|
||||
geometry: new ol.geom.Point([0, 0, 0]),
|
||||
fill: new ol.style.Fill({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
@@ -72,7 +72,7 @@ describe('ol.style.Style', function() {
|
||||
|
||||
it('the clone does not reference the same objects as the original', function() {
|
||||
var original = new ol.style.Style({
|
||||
geometry: new ol.geom .Point([0,0,0]),
|
||||
geometry: new ol.geom .Point([0, 0, 0]),
|
||||
fill: new ol.style.Fill({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
@@ -93,7 +93,7 @@ describe('ol.style.Style', function() {
|
||||
expect(original.getStroke()).not.to.be(clone.getStroke());
|
||||
expect(original.getText()).not.to.be(clone.getText());
|
||||
|
||||
clone.getGeometry().setCoordinates([1,1,1]);
|
||||
clone.getGeometry().setCoordinates([1, 1, 1]);
|
||||
clone.getFill().setColor('#012345');
|
||||
clone.getImage().setScale(2);
|
||||
clone.getStroke().setColor('#012345');
|
||||
|
||||
@@ -16,15 +16,15 @@ describe('ol.Tile', function() {
|
||||
tile.interimTile = next;
|
||||
return next;
|
||||
};
|
||||
var tail = addToChain(head,ol.Tile.State.IDLE); //discard, deprecated by head
|
||||
tail = addToChain(tail,ol.Tile.State.LOADING); //keep, request already going
|
||||
tail = addToChain(tail,ol.Tile.State.IDLE); //discard, deprecated by head
|
||||
tail = addToChain(tail,ol.Tile.State.LOADED); //keep, use for rendering
|
||||
var tail = addToChain(head, ol.Tile.State.IDLE); //discard, deprecated by head
|
||||
tail = addToChain(tail, ol.Tile.State.LOADING); //keep, request already going
|
||||
tail = addToChain(tail, ol.Tile.State.IDLE); //discard, deprecated by head
|
||||
tail = addToChain(tail, ol.Tile.State.LOADED); //keep, use for rendering
|
||||
renderTile = tail; //store this tile for later tests
|
||||
tail = addToChain(tail,ol.Tile.State.IDLE); //rest of list outdated by tile above
|
||||
tail = addToChain(tail,ol.Tile.State.LOADED);
|
||||
tail = addToChain(tail,ol.Tile.State.LOADING);
|
||||
tail = addToChain(tail,ol.Tile.State.LOADED);
|
||||
tail = addToChain(tail, ol.Tile.State.IDLE); //rest of list outdated by tile above
|
||||
tail = addToChain(tail, ol.Tile.State.LOADED);
|
||||
tail = addToChain(tail, ol.Tile.State.LOADING);
|
||||
tail = addToChain(tail, ol.Tile.State.LOADED);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -593,7 +593,7 @@ describe('ol.View', function() {
|
||||
view.animate({
|
||||
resolution: 2000,
|
||||
duration: 25
|
||||
},{
|
||||
}, {
|
||||
resolution: 2,
|
||||
duration: 25
|
||||
}, function() {
|
||||
|
||||
Reference in New Issue
Block a user