Indentation
This commit is contained in:
@@ -25,26 +25,22 @@ describe('ol.control.ZoomSlider', function() {
|
|||||||
describe('DOM creation', function() {
|
describe('DOM creation', function() {
|
||||||
it('creates the expected DOM elements', function() {
|
it('creates the expected DOM elements', function() {
|
||||||
var zoomSliderContainers = goog.dom.getElementsByClass(
|
var zoomSliderContainers = goog.dom.getElementsByClass(
|
||||||
'ol-zoomslider', target),
|
'ol-zoomslider', target);
|
||||||
zoomSliderContainer,
|
|
||||||
zoomSliderThumbs,
|
|
||||||
zoomSliderThumb,
|
|
||||||
hasUnselectableCls;
|
|
||||||
|
|
||||||
expect(zoomSliderContainers.length).to.be(1);
|
expect(zoomSliderContainers.length).to.be(1);
|
||||||
|
|
||||||
zoomSliderContainer = zoomSliderContainers[0];
|
var zoomSliderContainer = zoomSliderContainers[0];
|
||||||
expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true);
|
expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true);
|
||||||
|
|
||||||
hasUnselectableCls = goog.dom.classlist.contains(zoomSliderContainer,
|
var hasUnselectableCls = goog.dom.classlist.contains(zoomSliderContainer,
|
||||||
'ol-unselectable');
|
'ol-unselectable');
|
||||||
expect(hasUnselectableCls).to.be(true);
|
expect(hasUnselectableCls).to.be(true);
|
||||||
|
|
||||||
zoomSliderThumbs = goog.dom.getElementsByClass('ol-zoomslider-thumb',
|
var zoomSliderThumbs = goog.dom.getElementsByClass('ol-zoomslider-thumb',
|
||||||
zoomSliderContainer);
|
zoomSliderContainer);
|
||||||
expect(zoomSliderThumbs.length).to.be(1);
|
expect(zoomSliderThumbs.length).to.be(1);
|
||||||
|
|
||||||
zoomSliderThumb = zoomSliderThumbs[0];
|
var zoomSliderThumb = zoomSliderThumbs[0];
|
||||||
expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true);
|
expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true);
|
||||||
|
|
||||||
hasUnselectableCls = goog.dom.classlist.contains(zoomSliderThumb,
|
hasUnselectableCls = goog.dom.classlist.contains(zoomSliderThumb,
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ goog.provide('ol.test.coordinate');
|
|||||||
describe('ol.coordinate', function() {
|
describe('ol.coordinate', function() {
|
||||||
|
|
||||||
describe('#add', function() {
|
describe('#add', function() {
|
||||||
var coordinate,
|
var coordinate, delta;
|
||||||
delta;
|
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
coordinate = [50.73, 7.1];
|
coordinate = [50.73, 7.1];
|
||||||
@@ -31,13 +30,13 @@ describe('ol.coordinate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('#equals', function() {
|
describe('#equals', function() {
|
||||||
var cologne = [50.93333, 6.95],
|
var cologne = [50.93333, 6.95];
|
||||||
bonn1 = [50.73, 7.1],
|
var bonn1 = [50.73, 7.1];
|
||||||
bonn2 = [50.73000, 7.10000];
|
var bonn2 = [50.73000, 7.10000];
|
||||||
|
|
||||||
it('compares correctly', function() {
|
it('compares correctly', function() {
|
||||||
var bonnEqualsBonn = ol.coordinate.equals(bonn1, bonn2),
|
var bonnEqualsBonn = ol.coordinate.equals(bonn1, bonn2);
|
||||||
bonnEqualsCologne = ol.coordinate.equals(bonn1, cologne);
|
var bonnEqualsCologne = ol.coordinate.equals(bonn1, cologne);
|
||||||
expect(bonnEqualsBonn).to.be(true);
|
expect(bonnEqualsBonn).to.be(true);
|
||||||
expect(bonnEqualsCologne).to.be(false);
|
expect(bonnEqualsCologne).to.be(false);
|
||||||
});
|
});
|
||||||
@@ -61,9 +60,7 @@ describe('ol.coordinate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('#createStringXY', function() {
|
describe('#createStringXY', function() {
|
||||||
var coordinate,
|
var coordinate, created, formatted;
|
||||||
created,
|
|
||||||
formatted;
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
coordinate = [6.6123, 46.7919];
|
coordinate = [6.6123, 46.7919];
|
||||||
created = null;
|
created = null;
|
||||||
|
|||||||
@@ -270,8 +270,8 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
describe('#readFeatures', function() {
|
describe('#readFeatures', function() {
|
||||||
|
|
||||||
it('parses feature collection', function() {
|
it('parses feature collection', function() {
|
||||||
var str = JSON.stringify(data),
|
var str = JSON.stringify(data);
|
||||||
array = format.readFeatures(str);
|
var array = format.readFeatures(str);
|
||||||
|
|
||||||
expect(array.length).to.be(2);
|
expect(array.length).to.be(2);
|
||||||
|
|
||||||
@@ -545,12 +545,12 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('parses polygon', function() {
|
it('parses polygon', function() {
|
||||||
var outer = [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]],
|
var outer = [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]];
|
||||||
inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]],
|
var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]];
|
||||||
inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]],
|
var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
||||||
str = JSON.stringify({
|
var str = JSON.stringify({
|
||||||
rings: [outer, inner1, inner2]
|
rings: [outer, inner1, inner2]
|
||||||
});
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(ol.geom.Polygon);
|
expect(obj).to.be.a(ol.geom.Polygon);
|
||||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||||
@@ -563,13 +563,13 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('parses XYZ polygon', function() {
|
it('parses XYZ polygon', function() {
|
||||||
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]],
|
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]];
|
||||||
inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]],
|
var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]];
|
||||||
inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]],
|
var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
||||||
str = JSON.stringify({
|
var str = JSON.stringify({
|
||||||
rings: [outer, inner1, inner2],
|
rings: [outer, inner1, inner2],
|
||||||
hasZ: true
|
hasZ: true
|
||||||
});
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(ol.geom.Polygon);
|
expect(obj).to.be.a(ol.geom.Polygon);
|
||||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||||
@@ -582,13 +582,13 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('parses XYM polygon', function() {
|
it('parses XYM polygon', function() {
|
||||||
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]],
|
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]];
|
||||||
inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]],
|
var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]];
|
||||||
inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]],
|
var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
||||||
str = JSON.stringify({
|
var str = JSON.stringify({
|
||||||
rings: [outer, inner1, inner2],
|
rings: [outer, inner1, inner2],
|
||||||
hasM: true
|
hasM: true
|
||||||
});
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(ol.geom.Polygon);
|
expect(obj).to.be.a(ol.geom.Polygon);
|
||||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
||||||
@@ -601,17 +601,23 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('parses XYZM polygon', function() {
|
it('parses XYZM polygon', function() {
|
||||||
var outer = [[0, 0, 5, 1], [0, 10, 5, 1], [10, 10, 5, 1],
|
var outer = [
|
||||||
[10, 0, 5, 1], [0, 0, 5, 1]],
|
[0, 0, 5, 1], [0, 10, 5, 1], [10, 10, 5, 1],
|
||||||
inner1 = [[1, 1, 3, 2], [2, 1, 3, 2], [2, 2, 3, 2],
|
[10, 0, 5, 1], [0, 0, 5, 1]
|
||||||
[1, 2, 3, 2], [1, 1, 3, 2]],
|
];
|
||||||
inner2 = [[8, 8, 2, 1], [9, 8, 2, 1], [9, 9, 2, 1],
|
var inner1 = [
|
||||||
[8, 9, 2, 1], [8, 8, 2, 1]],
|
[1, 1, 3, 2], [2, 1, 3, 2], [2, 2, 3, 2],
|
||||||
str = JSON.stringify({
|
[1, 2, 3, 2], [1, 1, 3, 2]
|
||||||
rings: [outer, inner1, inner2],
|
];
|
||||||
hasZ: true,
|
var inner2 = [
|
||||||
hasM: true
|
[8, 8, 2, 1], [9, 8, 2, 1], [9, 9, 2, 1],
|
||||||
});
|
[8, 9, 2, 1], [8, 8, 2, 1]
|
||||||
|
];
|
||||||
|
var str = JSON.stringify({
|
||||||
|
rings: [outer, inner1, inner2],
|
||||||
|
hasZ: true,
|
||||||
|
hasM: true
|
||||||
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(ol.geom.Polygon);
|
expect(obj).to.be.a(ol.geom.Polygon);
|
||||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
||||||
@@ -811,9 +817,9 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes polygon', function() {
|
it('encodes polygon', function() {
|
||||||
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]],
|
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]];
|
||||||
inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]],
|
var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]];
|
||||||
inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
||||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2]);
|
var polygon = new ol.geom.Polygon([outer, inner1, inner2]);
|
||||||
var esrijson = format.writeGeometry(polygon);
|
var esrijson = format.writeGeometry(polygon);
|
||||||
expect(polygon.getCoordinates(false)).to.eql(
|
expect(polygon.getCoordinates(false)).to.eql(
|
||||||
@@ -821,9 +827,9 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYZ polygon', function() {
|
it('encodes XYZ polygon', function() {
|
||||||
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]],
|
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]];
|
||||||
inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]],
|
var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]];
|
||||||
inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
||||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
||||||
ol.geom.GeometryLayout.XYZ);
|
ol.geom.GeometryLayout.XYZ);
|
||||||
var esrijson = format.writeGeometry(polygon);
|
var esrijson = format.writeGeometry(polygon);
|
||||||
@@ -832,9 +838,9 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYM polygon', function() {
|
it('encodes XYM polygon', function() {
|
||||||
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]],
|
var outer = [[0, 0, 5], [0, 10, 5], [10, 10, 5], [10, 0, 5], [0, 0, 5]];
|
||||||
inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]],
|
var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]];
|
||||||
inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
||||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
||||||
ol.geom.GeometryLayout.XYM);
|
ol.geom.GeometryLayout.XYM);
|
||||||
var esrijson = format.writeGeometry(polygon);
|
var esrijson = format.writeGeometry(polygon);
|
||||||
@@ -843,12 +849,15 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYZM polygon', function() {
|
it('encodes XYZM polygon', function() {
|
||||||
var outer = [[0, 0, 5, 1], [0, 10, 5, 2], [10, 10, 5, 1],
|
var outer = [
|
||||||
[10, 0, 5, 1], [0, 0, 5, 1]],
|
[0, 0, 5, 1], [0, 10, 5, 2], [10, 10, 5, 1], [10, 0, 5, 1], [0, 0, 5, 1]
|
||||||
inner1 = [[1, 1, 3, 1], [2, 1, 3, 2], [2, 2, 3, 1], [1, 2, 3, 1],
|
];
|
||||||
[1, 1, 3, 1]],
|
var inner1 = [
|
||||||
inner2 = [[8, 8, 2, 1], [9, 8, 2, 2], [9, 9, 2, 1], [8, 9, 2, 1],
|
[1, 1, 3, 1], [2, 1, 3, 2], [2, 2, 3, 1], [1, 2, 3, 1], [1, 1, 3, 1]
|
||||||
[8, 8, 2, 1]];
|
];
|
||||||
|
var inner2 = [
|
||||||
|
[8, 8, 2, 1], [9, 8, 2, 2], [9, 9, 2, 1], [8, 9, 2, 1], [8, 8, 2, 1]
|
||||||
|
];
|
||||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
||||||
ol.geom.GeometryLayout.XYZM);
|
ol.geom.GeometryLayout.XYZM);
|
||||||
var esrijson = format.writeGeometry(polygon);
|
var esrijson = format.writeGeometry(polygon);
|
||||||
@@ -995,8 +1004,8 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
describe('#writeFeatures', function() {
|
describe('#writeFeatures', function() {
|
||||||
|
|
||||||
it('encodes feature collection', function() {
|
it('encodes feature collection', function() {
|
||||||
var str = JSON.stringify(data),
|
var str = JSON.stringify(data);
|
||||||
array = format.readFeatures(str);
|
var array = format.readFeatures(str);
|
||||||
var esrijson = format.writeFeaturesObject(array);
|
var esrijson = format.writeFeaturesObject(array);
|
||||||
var result = format.readFeatures(esrijson);
|
var result = format.readFeatures(esrijson);
|
||||||
expect(array.length).to.equal(result.length);
|
expect(array.length).to.equal(result.length);
|
||||||
@@ -1015,8 +1024,8 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('transforms and encodes feature collection', function() {
|
it('transforms and encodes feature collection', function() {
|
||||||
var str = JSON.stringify(data),
|
var str = JSON.stringify(data);
|
||||||
array = format.readFeatures(str);
|
var array = format.readFeatures(str);
|
||||||
var esrijson = format.writeFeatures(array, {
|
var esrijson = format.writeFeatures(array, {
|
||||||
featureProjection: 'EPSG:3857',
|
featureProjection: 'EPSG:3857',
|
||||||
dataProjection: 'EPSG:4326'
|
dataProjection: 'EPSG:4326'
|
||||||
|
|||||||
@@ -231,8 +231,8 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
describe('#readFeatures', function() {
|
describe('#readFeatures', function() {
|
||||||
|
|
||||||
it('parses feature collection', function() {
|
it('parses feature collection', function() {
|
||||||
var str = JSON.stringify(data),
|
var str = JSON.stringify(data);
|
||||||
array = format.readFeatures(str);
|
var array = format.readFeatures(str);
|
||||||
|
|
||||||
expect(array.length).to.be(2);
|
expect(array.length).to.be(2);
|
||||||
|
|
||||||
@@ -344,13 +344,13 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('parses polygon', function() {
|
it('parses polygon', function() {
|
||||||
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]],
|
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]];
|
||||||
inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]],
|
var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]];
|
||||||
inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]],
|
var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
||||||
str = JSON.stringify({
|
var str = JSON.stringify({
|
||||||
type: 'Polygon',
|
type: 'Polygon',
|
||||||
coordinates: [outer, inner1, inner2]
|
coordinates: [outer, inner1, inner2]
|
||||||
});
|
});
|
||||||
|
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(ol.geom.Polygon);
|
expect(obj).to.be.a(ol.geom.Polygon);
|
||||||
@@ -495,8 +495,8 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
describe('#writeFeatures', function() {
|
describe('#writeFeatures', function() {
|
||||||
|
|
||||||
it('encodes feature collection', function() {
|
it('encodes feature collection', function() {
|
||||||
var str = JSON.stringify(data),
|
var str = JSON.stringify(data);
|
||||||
array = format.readFeatures(str);
|
var array = format.readFeatures(str);
|
||||||
var geojson = format.writeFeaturesObject(array);
|
var geojson = format.writeFeaturesObject(array);
|
||||||
var result = format.readFeatures(geojson);
|
var result = format.readFeatures(geojson);
|
||||||
expect(array.length).to.equal(result.length);
|
expect(array.length).to.equal(result.length);
|
||||||
@@ -515,8 +515,8 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('transforms and encodes feature collection', function() {
|
it('transforms and encodes feature collection', function() {
|
||||||
var str = JSON.stringify(data),
|
var str = JSON.stringify(data);
|
||||||
array = format.readFeatures(str);
|
var array = format.readFeatures(str);
|
||||||
var geojson = format.writeFeatures(array, {
|
var geojson = format.writeFeatures(array, {
|
||||||
featureProjection: 'EPSG:3857'
|
featureProjection: 'EPSG:3857'
|
||||||
});
|
});
|
||||||
@@ -576,9 +576,9 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes polygon', function() {
|
it('encodes polygon', function() {
|
||||||
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]],
|
var outer = [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]];
|
||||||
inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]],
|
var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]];
|
||||||
inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
||||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2]);
|
var polygon = new ol.geom.Polygon([outer, inner1, inner2]);
|
||||||
var geojson = format.writeGeometry(polygon);
|
var geojson = format.writeGeometry(polygon);
|
||||||
expect(polygon.getCoordinates()).to.eql(
|
expect(polygon.getCoordinates()).to.eql(
|
||||||
|
|||||||
@@ -280,7 +280,8 @@ describe('ol.format.GML3', function() {
|
|||||||
describe('axis order', function() {
|
describe('axis order', function() {
|
||||||
|
|
||||||
it('can read and write a linestring geometry with ' +
|
it('can read and write a linestring geometry with ' +
|
||||||
'correct axis order', function() {
|
'correct axis order',
|
||||||
|
function() {
|
||||||
var text =
|
var text =
|
||||||
'<gml:LineString xmlns:gml="http://www.opengis.net/gml" ' +
|
'<gml:LineString xmlns:gml="http://www.opengis.net/gml" ' +
|
||||||
' srsName="urn:x-ogc:def:crs:EPSG:4326">' +
|
' srsName="urn:x-ogc:def:crs:EPSG:4326">' +
|
||||||
|
|||||||
@@ -19,20 +19,22 @@ describe('ol.geom.flat.interpolate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns the expected value when the mid point is an existing ' +
|
it('returns the expected value when the mid point is an existing ' +
|
||||||
'coordinate', function() {
|
'coordinate',
|
||||||
var flatCoordinates = [0, 1, 2, 3, 4, 5];
|
function() {
|
||||||
var point = ol.geom.flat.interpolate.lineString(
|
var flatCoordinates = [0, 1, 2, 3, 4, 5];
|
||||||
flatCoordinates, 0, 6, 2, 0.5);
|
var point = ol.geom.flat.interpolate.lineString(
|
||||||
expect(point).to.eql([2, 3]);
|
flatCoordinates, 0, 6, 2, 0.5);
|
||||||
});
|
expect(point).to.eql([2, 3]);
|
||||||
|
});
|
||||||
|
|
||||||
it('returns the expected value when the midpoint falls halfway between ' +
|
it('returns the expected value when the midpoint falls halfway between ' +
|
||||||
'two existing coordinates', function() {
|
'two existing coordinates',
|
||||||
var flatCoordinates = [0, 1, 2, 3, 4, 5, 6, 7];
|
function() {
|
||||||
var point = ol.geom.flat.interpolate.lineString(
|
var flatCoordinates = [0, 1, 2, 3, 4, 5, 6, 7];
|
||||||
flatCoordinates, 0, 8, 2, 0.5);
|
var point = ol.geom.flat.interpolate.lineString(
|
||||||
expect(point).to.eql([3, 4]);
|
flatCoordinates, 0, 8, 2, 0.5);
|
||||||
});
|
expect(point).to.eql([3, 4]);
|
||||||
|
});
|
||||||
|
|
||||||
it('returns the expected value when the coordinates are not evenly spaced',
|
it('returns the expected value when the coordinates are not evenly spaced',
|
||||||
function() {
|
function() {
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ describe('ol.geom.flat.intersectsextent', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('boundary does not intersect the extent and ring does not ' +
|
describe('boundary does not intersect the extent and ring does not ' +
|
||||||
'contain a corner of the extent', function() {
|
'contain a corner of the extent',
|
||||||
|
function() {
|
||||||
it('returns false', function() {
|
it('returns false', function() {
|
||||||
var extent = [2.0, 0.5, 3, 1.5];
|
var extent = [2.0, 0.5, 3, 1.5];
|
||||||
var r = ol.geom.flat.intersectsextent.linearRing(
|
var r = ol.geom.flat.intersectsextent.linearRing(
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ goog.require('ol.extent');
|
|||||||
|
|
||||||
describe('ol.geom.GeometryCollection', function() {
|
describe('ol.geom.GeometryCollection', function() {
|
||||||
|
|
||||||
var outer = [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]],
|
var outer = [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]];
|
||||||
inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]],
|
var inner1 = [[1, 1], [2, 1], [2, 2], [1, 2], [1, 1]];
|
||||||
inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
var inner2 = [[8, 8], [9, 8], [9, 9], [8, 9], [8, 8]];
|
||||||
|
|
||||||
describe('constructor', function() {
|
describe('constructor', function() {
|
||||||
|
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ describe('ol.interaction.Translate', function() {
|
|||||||
source.addFeatures(features);
|
source.addFeatures(features);
|
||||||
var layer = new ol.layer.Vector({source: source});
|
var layer = new ol.layer.Vector({source: source});
|
||||||
map = new ol.Map({
|
map = new ol.Map({
|
||||||
target: target,
|
target: target,
|
||||||
layers: [layer],
|
layers: [layer],
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
projection: 'EPSG:4326',
|
projection: 'EPSG:4326',
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
resolution: 1
|
resolution: 1
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
map.once('postrender', function() {
|
map.once('postrender', function() {
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -49,13 +49,14 @@ describe('ol.proj', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('gives that CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, EPSG:4326 are ' +
|
it('gives that CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, EPSG:4326 are ' +
|
||||||
'equivalent', function() {
|
'equivalent',
|
||||||
_testAllEquivalent([
|
function() {
|
||||||
'CRS:84',
|
_testAllEquivalent([
|
||||||
'urn:ogc:def:crs:EPSG:6.6:4326',
|
'CRS:84',
|
||||||
'EPSG:4326'
|
'urn:ogc:def:crs:EPSG:6.6:4326',
|
||||||
]);
|
'EPSG:4326'
|
||||||
});
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
it('requires code and units to be equal for projection evquivalence',
|
it('requires code and units to be equal for projection evquivalence',
|
||||||
function() {
|
function() {
|
||||||
|
|||||||
@@ -71,8 +71,9 @@ describe('ol.source.Tile', function() {
|
|||||||
var zoom = 1;
|
var zoom = 1;
|
||||||
var range = new ol.TileRange(0, 1, 0, 1);
|
var range = new ol.TileRange(0, 1, 0, 1);
|
||||||
|
|
||||||
var covered = source.forEachLoadedTile(source.getProjection(), zoom,
|
var covered = source.forEachLoadedTile(
|
||||||
range, function() {
|
source.getProjection(), zoom, range,
|
||||||
|
function() {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
expect(covered).to.be(true);
|
expect(covered).to.be(true);
|
||||||
@@ -90,8 +91,9 @@ describe('ol.source.Tile', function() {
|
|||||||
var zoom = 1;
|
var zoom = 1;
|
||||||
var range = new ol.TileRange(0, 1, 0, 1);
|
var range = new ol.TileRange(0, 1, 0, 1);
|
||||||
|
|
||||||
var covered = source.forEachLoadedTile(source.getProjection(), zoom,
|
var covered = source.forEachLoadedTile(
|
||||||
range, function() {
|
source.getProjection(), zoom,
|
||||||
|
range, function() {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
expect(covered).to.be(false);
|
expect(covered).to.be(false);
|
||||||
@@ -109,8 +111,9 @@ describe('ol.source.Tile', function() {
|
|||||||
var zoom = 1;
|
var zoom = 1;
|
||||||
var range = new ol.TileRange(0, 1, 0, 1);
|
var range = new ol.TileRange(0, 1, 0, 1);
|
||||||
|
|
||||||
var covered = source.forEachLoadedTile(source.getProjection(), zoom,
|
var covered = source.forEachLoadedTile(
|
||||||
range, function() {
|
source.getProjection(), zoom, range,
|
||||||
|
function() {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
expect(covered).to.be(false);
|
expect(covered).to.be(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user