Rename _ol_style_Text_ to Text

This commit is contained in:
Tim Schaub
2018-01-11 13:25:48 -07:00
parent fb22c587f8
commit c5a4be2edd
25 changed files with 131 additions and 131 deletions

View File

@@ -20,7 +20,7 @@ import IconAnchorUnits from '../../../../src/ol/style/IconAnchorUnits.js';
import IconOrigin from '../../../../src/ol/style/IconOrigin.js';
import Stroke from '../../../../src/ol/style/Stroke.js';
import Style from '../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
import Text from '../../../../src/ol/style/Text.js';
import _ol_xml_ from '../../../../src/ol/xml.js';
@@ -1944,7 +1944,7 @@ describe('ol.format.KML', function() {
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
var textStyle = style.getText();
expect(textStyle).to.be.an(_ol_style_Text_);
expect(textStyle).to.be.an(Text);
expect(textStyle.getScale()).to.be(0.25);
var textFillStyle = textStyle.getFill();
expect(textFillStyle).to.be.an(Fill);
@@ -2361,7 +2361,7 @@ describe('ol.format.KML', function() {
it('can write an feature\'s text style', function() {
var style = new Style({
text: new _ol_style_Text_({
text: new Text({
scale: 0.5,
text: 'foo',
fill: new Fill({

View File

@@ -2,7 +2,7 @@ import Graticule from '../../../src/ol/Graticule.js';
import Map from '../../../src/ol/Map.js';
import {get as getProjection} from '../../../src/ol/proj.js';
import Stroke from '../../../src/ol/style/Stroke.js';
import _ol_style_Text_ from '../../../src/ol/style/Text.js';
import Text from '../../../src/ol/style/Text.js';
describe('ol.Graticule', function() {
var graticule;
@@ -73,8 +73,8 @@ describe('ol.Graticule', function() {
});
it('can be configured with label options', function() {
var latLabelStyle = new _ol_style_Text_();
var lonLabelStyle = new _ol_style_Text_();
var latLabelStyle = new Text();
var lonLabelStyle = new Text();
graticule = new Graticule({
map: new Map({}),
showLabels: true,

View File

@@ -12,7 +12,7 @@ import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js';
import Fill from '../../../../../src/ol/style/Fill.js';
import Stroke from '../../../../../src/ol/style/Stroke.js';
import Style from '../../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
import Text from '../../../../../src/ol/style/Text.js';
describe('ol.render.canvas.Immediate', function() {
@@ -44,7 +44,7 @@ describe('ol.render.canvas.Immediate', function() {
sinon.spy(context, 'setTextStyle');
var fill = new Fill({});
var stroke = new Stroke({});
var text = new _ol_style_Text_({});
var text = new Text({});
var image = new _ol_style_Circle_({});
var style = new Style({
fill: fill,

View File

@@ -2,7 +2,7 @@ import Feature from '../../../../../src/ol/Feature.js';
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
import Polygon from '../../../../../src/ol/geom/Polygon.js';
import _ol_render_canvas_TextReplay_ from '../../../../../src/ol/render/canvas/TextReplay.js';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
import Text from '../../../../../src/ol/style/Text.js';
describe('ol.render.canvas.TextReplay', function() {
@@ -11,13 +11,13 @@ describe('ol.render.canvas.TextReplay', function() {
var geometry = new Polygon([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]);
var feature = new Feature(geometry);
replay.setTextStyle(new _ol_style_Text_({
replay.setTextStyle(new Text({
text: 'This is a long text'
}));
replay.drawText(geometry, feature);
expect(replay.instructions.length).to.be(0);
replay.setTextStyle(new _ol_style_Text_({
replay.setTextStyle(new Text({
text: 'short'
}));
replay.drawText(geometry, feature);
@@ -32,13 +32,13 @@ describe('ol.render.canvas.TextReplay', function() {
]);
var feature = new Feature(geometry);
replay.setTextStyle(new _ol_style_Text_({
replay.setTextStyle(new Text({
text: 'This is a long text'
}));
replay.drawText(geometry, feature);
expect(replay.instructions.length).to.be(0);
replay.setTextStyle(new _ol_style_Text_({
replay.setTextStyle(new Text({
text: 'short'
}));
replay.drawText(geometry, feature);

View File

@@ -3,13 +3,13 @@ import Point from '../../../../../src/ol/geom/Point.js';
import _ol_render_webgl_TextReplay_ from '../../../../../src/ol/render/webgl/TextReplay.js';
import Fill from '../../../../../src/ol/style/Fill.js';
import Stroke from '../../../../../src/ol/style/Stroke.js';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
import Text from '../../../../../src/ol/style/Text.js';
describe('ol.render.webgl.TextReplay', function() {
var replay;
var createTextStyle = function(fillStyle, strokeStyle, text) {
var textStyle = new _ol_style_Text_({
var textStyle = new Text({
rotateWithView: true,
rotation: 1.5,
scale: 2,

View File

@@ -11,7 +11,7 @@ import _ol_render_canvas_ from '../../../../../src/ol/render/canvas.js';
import CanvasVectorLayerRenderer from '../../../../../src/ol/renderer/canvas/VectorLayer.js';
import VectorSource from '../../../../../src/ol/source/Vector.js';
import Style from '../../../../../src/ol/style/Style.js';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
import Text from '../../../../../src/ol/style/Text.js';
describe('ol.renderer.canvas.VectorLayer', function() {
@@ -57,12 +57,12 @@ describe('ol.renderer.canvas.VectorLayer', function() {
target: target
});
var layerStyle = [new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'layer'
})
})];
var featureStyle = [new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'feature'
})
})];
@@ -94,7 +94,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
target: target
});
var layerStyle = new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'layer',
font: '12px "Unavailable Font",sans-serif'
})
@@ -125,7 +125,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
target: target
});
var layerStyle = new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'layer',
font: '12px sans-serif'
})
@@ -157,7 +157,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
target: target
});
var layerStyle = new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'layer',
font: '12px "Droid Sans",sans-serif'
})

View File

@@ -17,7 +17,7 @@ import _ol_render_Feature_ 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';
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
import Text from '../../../../../src/ol/style/Text.js';
import _ol_tilegrid_ from '../../../../../src/ol/tilegrid.js';
@@ -46,12 +46,12 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
target: target
});
layerStyle = [new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'layer'
})
})];
var featureStyle = [new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'feature'
})
})];
@@ -217,7 +217,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
var layer2 = new VectorTileLayer({
source: source,
style: new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'layer2'
})
})

View File

@@ -4,7 +4,7 @@ import Style from '../../../../src/ol/style/Style.js';
import Fill from '../../../../src/ol/style/Fill.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
import Stroke from '../../../../src/ol/style/Stroke.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
import Text from '../../../../src/ol/style/Text.js';
describe('ol.style.Style', function() {
@@ -18,7 +18,7 @@ describe('ol.style.Style', function() {
width: 1
});
var testText = new _ol_style_Text_({
var testText = new Text({
font: '12px Calibri,sans-serif',
fill: new Fill({
color: '#000'
@@ -54,7 +54,7 @@ describe('ol.style.Style', function() {
stroke: new Stroke({
color: '#319FD3'
}),
text: new _ol_style_Text_({
text: new Text({
text: 'test'
}),
zIndex: 2
@@ -80,7 +80,7 @@ describe('ol.style.Style', function() {
stroke: new Stroke({
color: '#319FD3'
}),
text: new _ol_style_Text_({
text: new Text({
text: 'test'
})
});

View File

@@ -1,6 +1,6 @@
import Fill from '../../../../src/ol/style/Fill.js';
import Stroke from '../../../../src/ol/style/Stroke.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
import Text from '../../../../src/ol/style/Text.js';
describe('ol.style.Text', function() {
@@ -8,19 +8,19 @@ describe('ol.style.Text', function() {
describe('#constructor', function() {
it('uses a default fill style if none passed', function() {
var style = new _ol_style_Text_();
var style = new Text();
expect(style.getFill().getColor()).to.be('#333');
});
it('uses a provided fill style if one passed', function() {
var style = new _ol_style_Text_({
var style = new Text({
fill: new Fill({color: '#123456'})
});
expect(style.getFill().getColor()).to.be('#123456');
});
it('can always be resetted to no color', function() {
var style = new _ol_style_Text_();
var style = new Text();
style.getFill().setColor();
expect(style.getFill().getColor()).to.be(undefined);
});
@@ -30,14 +30,14 @@ describe('ol.style.Text', function() {
describe('#clone', function() {
it('creates a new ol.style.Text', function() {
var original = new _ol_style_Text_();
var original = new Text();
var clone = original.clone();
expect(clone).to.be.an(_ol_style_Text_);
expect(clone).to.be.an(Text);
expect(clone).to.not.be(original);
});
it('copies all values', function() {
var original = new _ol_style_Text_({
var original = new Text({
font: '12px serif',
offsetX: 4,
offsetY: 10,
@@ -77,7 +77,7 @@ describe('ol.style.Text', function() {
});
it('the clone does not reference the same objects as the original', function() {
var original = new _ol_style_Text_({
var original = new Text({
fill: new Fill({
color: '#319FD3'
}),