Transformed
This commit is contained in:
@@ -1,40 +1,38 @@
|
||||
|
||||
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.VectorImageTile');
|
||||
goog.require('ol.VectorTile');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.format.TextFeature');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Projection');
|
||||
import _ol_Feature_ from '../../../src/ol/Feature.js';
|
||||
import _ol_VectorImageTile_ from '../../../src/ol/VectorImageTile.js';
|
||||
import _ol_VectorTile_ from '../../../src/ol/VectorTile.js';
|
||||
import _ol_events_ from '../../../src/ol/events.js';
|
||||
import _ol_format_TextFeature_ from '../../../src/ol/format/TextFeature.js';
|
||||
import _ol_proj_ from '../../../src/ol/proj.js';
|
||||
import _ol_proj_Projection_ from '../../../src/ol/proj/Projection.js';
|
||||
|
||||
|
||||
describe('ol.VectorTile', function() {
|
||||
|
||||
it('loader sets features on the tile and updates proj units', function(done) {
|
||||
// mock format that return a tile-pixels feature
|
||||
var format = new ol.format.TextFeature();
|
||||
var format = new _ol_format_TextFeature_();
|
||||
format.readProjection = function(source) {
|
||||
return new ol.proj.Projection({
|
||||
return new _ol_proj_Projection_({
|
||||
code: '',
|
||||
units: 'tile-pixels'
|
||||
});
|
||||
};
|
||||
format.readFeatures = function(source, options) {
|
||||
return [new ol.Feature()];
|
||||
return [new _ol_Feature_()];
|
||||
};
|
||||
|
||||
var tile = new ol.VectorTile([0, 0, 0], null, null, format);
|
||||
var tile = new _ol_VectorTile_([0, 0, 0], null, null, format);
|
||||
var url = 'spec/ol/data/point.json';
|
||||
|
||||
ol.VectorImageTile.defaultLoadFunction(tile, url);
|
||||
_ol_VectorImageTile_.defaultLoadFunction(tile, url);
|
||||
var loader = tile.loader_;
|
||||
ol.events.listen(tile, 'change', function(e) {
|
||||
_ol_events_.listen(tile, 'change', function(e) {
|
||||
expect(tile.getFeatures().length).to.be.greaterThan(0);
|
||||
expect(tile.getProjection().getUnits()).to.be('tile-pixels');
|
||||
done();
|
||||
});
|
||||
loader.call(tile, [], 1, ol.proj.get('EPSG:3857'));
|
||||
loader.call(tile, [], 1, _ol_proj_.get('EPSG:3857'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user