Transformed
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.MultiLineString');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.render.Feature');
|
||||
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
|
||||
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
|
||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
||||
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
|
||||
import _ol_render_Feature_ 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 _ol_render_Feature_(type, flatCoordinates, ends, properties, 'foo');
|
||||
expect(renderFeature).to.be.a(_ol_render_Feature_);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 _ol_render_Feature_('LineString', [-1, -2, 2, 1], null, {});
|
||||
expect(feature.getExtent()).to.eql([-1, -2, 2, 1]);
|
||||
});
|
||||
});
|
||||
@@ -55,8 +55,8 @@ describe('ol.render.Feature', function() {
|
||||
|
||||
describe('#getFlatInteriorPoint()', function() {
|
||||
it('returns correct point and caches it', function() {
|
||||
var polygon = new ol.geom.Polygon([[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]);
|
||||
var feature = new ol.render.Feature('Polygon', polygon.getOrientedFlatCoordinates(),
|
||||
var polygon = new _ol_geom_Polygon_([[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]);
|
||||
var feature = new _ol_render_Feature_('Polygon', polygon.getOrientedFlatCoordinates(),
|
||||
polygon.getEnds());
|
||||
expect(feature.getFlatInteriorPoint()).to.eql([5, 5, 10]);
|
||||
expect(feature.getFlatInteriorPoint()).to.be(feature.flatInteriorPoints_);
|
||||
@@ -65,11 +65,11 @@ describe('ol.render.Feature', function() {
|
||||
|
||||
describe('#getFlatInteriorPoints()', function() {
|
||||
it('returns correct points and caches them', function() {
|
||||
var polygon = new ol.geom.MultiPolygon([
|
||||
var polygon = new _ol_geom_MultiPolygon_([
|
||||
[[[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 _ol_render_Feature_('MultiPolygon', polygon.getOrientedFlatCoordinates(),
|
||||
polygon.getEndss());
|
||||
expect(feature.getFlatInteriorPoints()).to.eql([5, 5, 10, 15, 5, 10]);
|
||||
expect(feature.getFlatInteriorPoints()).to.be(feature.flatInteriorPoints_);
|
||||
@@ -78,8 +78,8 @@ describe('ol.render.Feature', function() {
|
||||
|
||||
describe('#getFlatMidpoint()', function() {
|
||||
it('returns correct point', function() {
|
||||
var line = new ol.geom.LineString([[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]);
|
||||
var feature = new ol.render.Feature('LineString', line.getFlatCoordinates());
|
||||
var line = new _ol_geom_LineString_([[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]);
|
||||
var feature = new _ol_render_Feature_('LineString', line.getFlatCoordinates());
|
||||
expect(feature.getFlatMidpoint()).to.eql([10, 10]);
|
||||
expect(feature.getFlatMidpoint()).to.eql(feature.flatMidpoints_);
|
||||
});
|
||||
@@ -87,11 +87,11 @@ describe('ol.render.Feature', function() {
|
||||
|
||||
describe('#getFlatMidpoints()', function() {
|
||||
it('returns correct points and caches them', function() {
|
||||
var line = new ol.geom.MultiLineString([
|
||||
var line = new _ol_geom_MultiLineString_([
|
||||
[[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 _ol_render_Feature_('MultiLineString', line.getFlatCoordinates(),
|
||||
line.getEnds());
|
||||
expect(feature.getFlatMidpoints()).to.eql([10, 10, 20, 10]);
|
||||
expect(feature.getFlatMidpoints()).to.be(feature.flatMidpoints_);
|
||||
|
||||
Reference in New Issue
Block a user