Rename _ol_render_Feature_ to RenderFeature

This commit is contained in:
Tim Schaub
2018-01-11 13:45:50 -07:00
parent 8cba211ecd
commit b7718fb0ed
5 changed files with 38 additions and 38 deletions

View File

@@ -4,7 +4,7 @@ import MVT from '../../../../src/ol/format/MVT.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
import RenderFeature from '../../../../src/ol/render/Feature.js';
where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
@@ -25,7 +25,7 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
it('uses ol.render.Feature as feature class by default', function() {
var format = new MVT({layers: ['water']});
var features = format.readFeatures(data);
expect(features[0]).to.be.a(_ol_render_Feature_);
expect(features[0]).to.be.a(RenderFeature);
});
it('parses only specified layers', function() {
@@ -185,7 +185,7 @@ describe('ol.format.MVT', function() {
};
var feature = format.createFeature_({}, rawFeature);
MVT.readRawGeometry_ = readRawGeometry_;
expect(feature).to.be.a(_ol_render_Feature_);
expect(feature).to.be.a(RenderFeature);
expect(feature.getType()).to.be('Polygon');
expect(feature.getFlatCoordinates()).to.equal(createdFlatCoordinates);
expect(feature.getEnds()).to.equal(createdEnds);

View File

@@ -2,7 +2,7 @@ import LineString from '../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
import RenderFeature from '../../../../src/ol/render/Feature.js';
describe('ol.render.Feature', function() {
@@ -16,8 +16,8 @@ describe('ol.render.Feature', function() {
describe('Constructor', function() {
it('creates an instance', function() {
renderFeature =
new _ol_render_Feature_(type, flatCoordinates, ends, properties, 'foo');
expect(renderFeature).to.be.a(_ol_render_Feature_);
new RenderFeature(type, flatCoordinates, ends, properties, 'foo');
expect(renderFeature).to.be.a(RenderFeature);
});
});
@@ -42,7 +42,7 @@ describe('ol.render.Feature', function() {
});
it('returns the correct extent for a linestring', function() {
var feature =
new _ol_render_Feature_('LineString', [-1, -2, 2, 1], null, {});
new RenderFeature('LineString', [-1, -2, 2, 1], null, {});
expect(feature.getExtent()).to.eql([-1, -2, 2, 1]);
});
});
@@ -56,7 +56,7 @@ describe('ol.render.Feature', function() {
describe('#getFlatInteriorPoint()', function() {
it('returns correct point and caches it', function() {
var polygon = new Polygon([[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]);
var feature = new _ol_render_Feature_('Polygon', polygon.getOrientedFlatCoordinates(),
var feature = new RenderFeature('Polygon', polygon.getOrientedFlatCoordinates(),
polygon.getEnds());
expect(feature.getFlatInteriorPoint()).to.eql([5, 5, 10]);
expect(feature.getFlatInteriorPoint()).to.be(feature.flatInteriorPoints_);
@@ -69,7 +69,7 @@ describe('ol.render.Feature', function() {
[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]],
[[[10, 0], [10, 10], [20, 10], [20, 0], [10, 0]]]
]);
var feature = new _ol_render_Feature_('MultiPolygon', polygon.getOrientedFlatCoordinates(),
var feature = new RenderFeature('MultiPolygon', polygon.getOrientedFlatCoordinates(),
polygon.getEndss());
expect(feature.getFlatInteriorPoints()).to.eql([5, 5, 10, 15, 5, 10]);
expect(feature.getFlatInteriorPoints()).to.be(feature.flatInteriorPoints_);
@@ -79,7 +79,7 @@ describe('ol.render.Feature', function() {
describe('#getFlatMidpoint()', function() {
it('returns correct point', function() {
var line = new LineString([[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]);
var feature = new _ol_render_Feature_('LineString', line.getFlatCoordinates());
var feature = new RenderFeature('LineString', line.getFlatCoordinates());
expect(feature.getFlatMidpoint()).to.eql([10, 10]);
expect(feature.getFlatMidpoint()).to.eql(feature.flatMidpoints_);
});
@@ -91,7 +91,7 @@ describe('ol.render.Feature', function() {
[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]],
[[10, 0], [10, 10], [20, 10], [20, 0], [10, 0]]
]);
var feature = new _ol_render_Feature_('MultiLineString', line.getFlatCoordinates(),
var feature = new RenderFeature('MultiLineString', line.getFlatCoordinates(),
line.getEnds());
expect(feature.getFlatMidpoints()).to.eql([10, 10, 20, 10]);
expect(feature.getFlatMidpoints()).to.be(feature.flatMidpoints_);

View File

@@ -13,7 +13,7 @@ import VectorTileLayer from '../../../../../src/ol/layer/VectorTile.js';
import {get as getProjection, fromLonLat} from '../../../../../src/ol/proj.js';
import Projection from '../../../../../src/ol/proj/Projection.js';
import _ol_render_canvas_ from '../../../../../src/ol/render/canvas.js';
import _ol_render_Feature_ from '../../../../../src/ol/render/Feature.js';
import RenderFeature from '../../../../../src/ol/render/Feature.js';
import CanvasVectorTileLayerRenderer from '../../../../../src/ol/renderer/canvas/VectorTileLayer.js';
import VectorTileSource from '../../../../../src/ol/source/VectorTile.js';
import Style from '../../../../../src/ol/style/Style.js';
@@ -57,7 +57,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
})];
feature1 = new Feature(new Point([1, -1]));
feature2 = new Feature(new Point([0, 0]));
feature3 = new _ol_render_Feature_('Point', [1, -1], []);
feature3 = new RenderFeature('Point', [1, -1], []);
feature2.setStyle(featureStyle);
var TileClass = function() {
VectorTile.apply(this, arguments);