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

@@ -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.rendering.layer.Vector', function() {
@@ -606,7 +606,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true);
layer.setStyle(function(feature) {
return new Style({
text: new _ol_style_Text_({
text: new Text({
text: feature.get('text'),
font: '12px sans-serif'
})
@@ -647,7 +647,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setDeclutter(true);
layer.setStyle(function(feature) {
return new Style({
text: new _ol_style_Text_({
text: new Text({
text: feature.get('text'),
font: '12px sans-serif'
})
@@ -690,7 +690,7 @@ describe('ol.rendering.layer.Vector', function() {
layer.setStyle(function(feature) {
return new Style({
zIndex: feature.get('zIndex'),
text: new _ol_style_Text_({
text: new Text({
text: feature.get('text'),
font: '12px sans-serif'
})
@@ -850,7 +850,7 @@ describe('ol.rendering.layer.Vector', function() {
color: 'blue'
})
}),
text: new _ol_style_Text_({
text: new Text({
text: feature.get('text'),
font: '12px sans-serif',
textBaseline: 'bottom',
@@ -890,7 +890,7 @@ describe('ol.rendering.layer.Vector', function() {
color: '#CCC',
width: 12
}),
text: new _ol_style_Text_({
text: new Text({
placement: 'line',
text: 'east-west',
font: '12px sans-serif'
@@ -933,7 +933,7 @@ describe('ol.rendering.layer.Vector', function() {
color: '#CCC',
width: 12
}),
text: new _ol_style_Text_({
text: new Text({
placement: 'line',
text: 'east-west',
font: '12px sans-serif'
@@ -978,7 +978,7 @@ describe('ol.rendering.layer.Vector', function() {
color: '#CCC',
width: 12
}),
text: new _ol_style_Text_({
text: new Text({
placement: 'line',
text: 'east-west',
font: '12px sans-serif'

View File

@@ -11,7 +11,7 @@ import VectorTileSource from '../../../../src/ol/source/VectorTile.js';
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
import Fill from '../../../../src/ol/style/Fill.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';
@@ -150,7 +150,7 @@ describe('ol.rendering.layer.VectorTile', function() {
color: 'red'
})
}),
text: new _ol_style_Text_({
text: new Text({
text: feature.get('name_en'),
font: '12px sans-serif',
textBaseline: 'bottom',

View File

@@ -8,7 +8,7 @@ import Map from '../../../../src/ol/Map.js';
import View from '../../../../src/ol/View.js';
import VectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js';
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
import Text from '../../../../src/ol/style/Text.js';
import Fill from '../../../../src/ol/style/Fill.js';
import Style from '../../../../src/ol/style/Style.js';
import Stroke from '../../../../src/ol/style/Stroke.js';
@@ -53,7 +53,7 @@ describe('ol.rendering.style.Text', function() {
geometry: new Point([-20, 18])
});
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
scale: scale,
text: 'hello',
font: '10px sans-serif'
@@ -65,7 +65,7 @@ describe('ol.rendering.style.Text', function() {
geometry: new Point([-10, 0])
});
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
scale: scale,
text: 'hello',
fill: new Fill({
@@ -84,7 +84,7 @@ describe('ol.rendering.style.Text', function() {
geometry: new Point([20, 10])
});
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
scale: scale,
rotateWithView: true,
text: 'hello',
@@ -111,7 +111,7 @@ describe('ol.rendering.style.Text', function() {
stroke: new Stroke({
color: 'red'
}),
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world',
font: 'bold 14px sans-serif',
scale: scale || 1,
@@ -177,7 +177,7 @@ describe('ol.rendering.style.Text', function() {
var feature;
feature = new Feature(new Point([25, 0]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world\nleft',
font: 'bold 14px sans-serif',
textAlign: 'left'
@@ -186,7 +186,7 @@ describe('ol.rendering.style.Text', function() {
vectorSource.addFeature(feature);
feature = new Feature(new Point([-25, 0]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world\nright',
font: 'bold 14px sans-serif',
textAlign: 'right'
@@ -195,7 +195,7 @@ describe('ol.rendering.style.Text', function() {
vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 25]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world\nbottom',
font: 'bold 14px sans-serif',
textBaseline: 'bottom'
@@ -204,7 +204,7 @@ describe('ol.rendering.style.Text', function() {
vectorSource.addFeature(feature);
feature = new Feature(new Point([0, -25]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'top\nHello world',
font: 'bold 14px sans-serif',
textBaseline: 'top'
@@ -219,7 +219,7 @@ describe('ol.rendering.style.Text', function() {
var feature;
feature = new Feature(new Point([0, 0]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world\nleft',
font: 'bold 14px sans-serif',
textAlign: 'left',
@@ -229,7 +229,7 @@ describe('ol.rendering.style.Text', function() {
vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 0]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world\nright',
font: 'bold 14px sans-serif',
textAlign: 'right',
@@ -239,7 +239,7 @@ describe('ol.rendering.style.Text', function() {
vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 0]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world\nbottom',
font: 'bold 14px sans-serif',
textBaseline: 'bottom',
@@ -249,7 +249,7 @@ describe('ol.rendering.style.Text', function() {
vectorSource.addFeature(feature);
feature = new Feature(new Point([0, 0]));
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'top\nHello world',
font: 'bold 14px sans-serif',
textBaseline: 'top',
@@ -274,7 +274,7 @@ describe('ol.rendering.style.Text', function() {
geom.appendLineString(line);
var feature = new Feature(geom);
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world',
placement: 'line',
font: 'bold 30px sans-serif'
@@ -291,7 +291,7 @@ describe('ol.rendering.style.Text', function() {
geom.setFlatCoordinates('XY', polygon, [polygon.length]);
var feature = new Feature(geom);
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world',
font: 'bold 24px sans-serif',
placement: 'line',
@@ -317,7 +317,7 @@ describe('ol.rendering.style.Text', function() {
multiPolygon.appendPolygon(geom);
var feature = new Feature(multiPolygon);
feature.setStyle(new Style({
text: new _ol_style_Text_({
text: new Text({
text: 'Hello world',
font: 'bold 24px sans-serif',
placement: 'line',

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'
}),