Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions
+25 -27
View File
@@ -1,37 +1,35 @@
goog.require('ol.Feature');
goog.require('ol.geom.LineString');
goog.require('ol.geom.Point');
goog.require('ol.geom.Polygon');
goog.require('ol.proj');
goog.require('ol.source.Cluster');
goog.require('ol.source.Source');
goog.require('ol.source.Vector');
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_proj_ from '../../../../src/ol/proj.js';
import _ol_source_Cluster_ from '../../../../src/ol/source/Cluster.js';
import _ol_source_Source_ from '../../../../src/ol/source/Source.js';
import _ol_source_Vector_ from '../../../../src/ol/source/Vector.js';
describe('ol.source.Cluster', function() {
describe('constructor', function() {
it('returns a cluster source', function() {
var source = new ol.source.Cluster({
projection: ol.proj.get('EPSG:4326'),
source: new ol.source.Vector()
var source = new _ol_source_Cluster_({
projection: _ol_proj_.get('EPSG:4326'),
source: new _ol_source_Vector_()
});
expect(source).to.be.a(ol.source.Source);
expect(source).to.be.a(ol.source.Cluster);
expect(source).to.be.a(_ol_source_Source_);
expect(source).to.be.a(_ol_source_Cluster_);
expect(source.getDistance()).to.be(20);
});
});
describe('#loadFeatures', function() {
var extent = [-1, -1, 1, 1];
var projection = ol.proj.get('EPSG:3857');
var projection = _ol_proj_.get('EPSG:3857');
it('clusters a source with point features', function() {
var source = new ol.source.Cluster({
source: new ol.source.Vector({
var source = new _ol_source_Cluster_({
source: new _ol_source_Vector_({
features: [
new ol.Feature(new ol.geom.Point([0, 0])),
new ol.Feature(new ol.geom.Point([0, 0]))
new _ol_Feature_(new _ol_geom_Point_([0, 0])),
new _ol_Feature_(new _ol_geom_Point_([0, 0]))
]
})
});
@@ -40,7 +38,7 @@ describe('ol.source.Cluster', function() {
expect(source.getFeatures()[0].get('features').length).to.be(2);
});
it('clusters with a custom geometryFunction', function() {
var source = new ol.source.Cluster({
var source = new _ol_source_Cluster_({
geometryFunction: function(feature) {
var geom = feature.getGeometry();
if (geom.getType() == 'Point') {
@@ -50,11 +48,11 @@ describe('ol.source.Cluster', function() {
}
return null;
},
source: new ol.source.Vector({
source: new _ol_source_Vector_({
features: [
new ol.Feature(new ol.geom.Point([0, 0])),
new ol.Feature(new ol.geom.LineString([[0, 0], [1, 1]])),
new ol.Feature(new ol.geom.Polygon(
new _ol_Feature_(new _ol_geom_Point_([0, 0])),
new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [1, 1]])),
new _ol_Feature_(new _ol_geom_Polygon_(
[[[-1, -1], [-1, 1], [1, 1], [1, -1], [-1, -1]]]))
]
})
@@ -67,9 +65,9 @@ describe('ol.source.Cluster', function() {
describe('#setDistance', function() {
it('changes the distance value', function() {
var source = new ol.source.Cluster({
var source = new _ol_source_Cluster_({
distance: 100,
source: new ol.source.Vector()
source: new _ol_source_Vector_()
});
expect(source.getDistance()).to.be(100);
source.setDistance(10);