Rename _ol_style_Style_ to Style
This commit is contained in:
@@ -4,7 +4,7 @@ import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||
import TileLayer from '../../../../src/ol/layer/Tile.js';
|
||||
import XYZ from '../../../../src/ol/source/XYZ.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
|
||||
|
||||
describe('layer clipping', function() {
|
||||
@@ -69,7 +69,7 @@ describe('layer clipping', function() {
|
||||
[[[80, -40], [120, 0], [80, 40], [40, 0], [80, -40]]]
|
||||
]).transform('EPSG:4326', 'EPSG:3857');
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
width: 2,
|
||||
color: 'blue'
|
||||
|
||||
@@ -11,7 +11,7 @@ import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
smallLine.setStyle(new _ol_style_Style_({
|
||||
smallLine.setStyle(new Style({
|
||||
zIndex: -99,
|
||||
stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
|
||||
}));
|
||||
@@ -105,7 +105,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
smallLine.setStyle(new _ol_style_Style_({
|
||||
smallLine.setStyle(new Style({
|
||||
zIndex: -99,
|
||||
stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
|
||||
}));
|
||||
@@ -133,10 +133,10 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
smallLine.setStyle([
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 45, color: 'white'})
|
||||
})
|
||||
]);
|
||||
@@ -146,10 +146,10 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0], center[1] + 1000]
|
||||
]));
|
||||
smallLine2.setStyle([
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 35, color: 'blue'})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 15, color: 'green'})
|
||||
})
|
||||
]);
|
||||
@@ -172,10 +172,10 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
smallLine.setStyle([
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 75, color: 'red'})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 45, color: 'white'})
|
||||
})
|
||||
]);
|
||||
@@ -185,10 +185,10 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0], center[1] + 1000]
|
||||
]));
|
||||
smallLine2.setStyle([
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 35, color: 'blue'})
|
||||
}),
|
||||
new _ol_style_Style_({
|
||||
new Style({
|
||||
stroke: new _ol_style_Stroke_({width: 15, color: 'green'})
|
||||
})
|
||||
]);
|
||||
@@ -212,7 +212,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
addCircle(500);
|
||||
map.addLayer(new VectorLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
width: 2,
|
||||
color: 'black'
|
||||
@@ -233,7 +233,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
map.addLayer(new VectorLayer({
|
||||
renderMode: 'image',
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
width: 2,
|
||||
color: 'black'
|
||||
@@ -254,7 +254,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
map.addLayer(new VectorLayer({
|
||||
renderMode: 'image',
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(255,0,0,0.5)'
|
||||
}),
|
||||
@@ -285,7 +285,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
addPolygon(720);
|
||||
map.addLayer(new VectorLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#3399CC',
|
||||
width: 1.25
|
||||
@@ -309,7 +309,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
addLineString(720);
|
||||
map.addLayer(new VectorLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#3399CC',
|
||||
width: 1.25
|
||||
@@ -350,7 +350,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
source: createSource(true),
|
||||
style: function(feature) {
|
||||
alternateColor();
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: alternateColor(),
|
||||
width: 1.25
|
||||
@@ -401,7 +401,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
source: createSource(true),
|
||||
style: function(feature) {
|
||||
alternateColor();
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: alternateColor(),
|
||||
width: 1.25
|
||||
@@ -470,7 +470,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
source: new VectorSource({
|
||||
features: [feature]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'blue'
|
||||
})
|
||||
@@ -534,7 +534,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
|
||||
it('renders partially out-of-view polygons with a fill and stroke', function(done) {
|
||||
layer.setStyle(new _ol_style_Style_({
|
||||
layer.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: [0, 0, 0, 1],
|
||||
width: 2
|
||||
@@ -550,7 +550,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
|
||||
it('renders partially out-of-view polygons with a fill', function(done) {
|
||||
layer.setStyle(new _ol_style_Style_({
|
||||
layer.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: [0, 0, 0, 1]
|
||||
})
|
||||
@@ -562,7 +562,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
|
||||
it('renders partially out-of-view polygons with a stroke', function(done) {
|
||||
layer.setStyle(new _ol_style_Style_({
|
||||
layer.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: [0, 0, 0, 1],
|
||||
width: 2
|
||||
@@ -605,7 +605,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
layer.setDeclutter(true);
|
||||
layer.setStyle(function(feature) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: feature.get('text'),
|
||||
font: '12px sans-serif'
|
||||
@@ -646,7 +646,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
layer.setDeclutter(true);
|
||||
layer.setStyle(function(feature) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: feature.get('text'),
|
||||
font: '12px sans-serif'
|
||||
@@ -688,7 +688,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
layer.setDeclutter(true);
|
||||
layer.setStyle(function(feature) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
zIndex: feature.get('zIndex'),
|
||||
text: new _ol_style_Text_({
|
||||
text: feature.get('text'),
|
||||
@@ -723,7 +723,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
layer.setDeclutter(true);
|
||||
layer.setStyle(function(feature) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 15,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
@@ -763,7 +763,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
layer.setDeclutter(true);
|
||||
layer.setStyle(function(feature) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 15,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
@@ -804,7 +804,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
layer.setDeclutter(true);
|
||||
layer.setStyle(function(feature) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
zIndex: feature.get('zIndex'),
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 15,
|
||||
@@ -843,7 +843,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
layer.setDeclutter(true);
|
||||
layer.setStyle(function(feature) {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 5,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
@@ -873,7 +873,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
map.addLayer(layer);
|
||||
|
||||
var point = new Feature(new Point(center));
|
||||
point.setStyle(new _ol_style_Style_({
|
||||
point.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 8,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
@@ -885,7 +885,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0] - 650, center[1] - 200],
|
||||
[center[0] + 650, center[1] - 200]
|
||||
]));
|
||||
line.setStyle(new _ol_style_Style_({
|
||||
line.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#CCC',
|
||||
width: 12
|
||||
@@ -916,7 +916,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
map.addLayer(layer);
|
||||
|
||||
var point = new Feature(new Point(center));
|
||||
point.setStyle(new _ol_style_Style_({
|
||||
point.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 8,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
@@ -928,7 +928,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0] - 650, center[1] - 200],
|
||||
[center[0] + 650, center[1] - 200]
|
||||
]));
|
||||
line.setStyle(new _ol_style_Style_({
|
||||
line.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#CCC',
|
||||
width: 12
|
||||
@@ -959,7 +959,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
map.addLayer(layer);
|
||||
|
||||
var point = new Feature(new Point(center));
|
||||
point.setStyle(new _ol_style_Style_({
|
||||
point.setStyle(new Style({
|
||||
zIndex: 2,
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 8,
|
||||
@@ -972,7 +972,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
[center[0] - 650, center[1] - 200],
|
||||
[center[0] + 650, center[1] - 200]
|
||||
]));
|
||||
line.setStyle(new _ol_style_Style_({
|
||||
line.setStyle(new Style({
|
||||
zIndex: 1,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#CCC',
|
||||
|
||||
@@ -10,7 +10,7 @@ import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import VectorTileSource from '../../../../src/ol/source/VectorTile.js';
|
||||
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
|
||||
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
|
||||
|
||||
@@ -104,7 +104,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
||||
map.addLayer(new VectorLayer({
|
||||
zIndex: 1,
|
||||
source: vectorSource,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 10,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -143,7 +143,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
||||
var style = function(feature, resolution) {
|
||||
var geom = feature.getGeometry();
|
||||
if (geom.getType() == 'Point') {
|
||||
return new _ol_style_Style_({
|
||||
return new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 7,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -7,7 +7,7 @@ import CanvasImmediateRenderer from '../../../src/ol/render/canvas/Immediate.js'
|
||||
import _ol_style_Circle_ from '../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../src/ol/style/Style.js';
|
||||
import Style from '../../../src/ol/style/Style.js';
|
||||
|
||||
function getContext() {
|
||||
return document.createElement('canvas').getContext('2d');
|
||||
@@ -33,7 +33,7 @@ describe('ol.render', function() {
|
||||
size: [100, 100]
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'green'
|
||||
@@ -57,7 +57,7 @@ describe('ol.render', function() {
|
||||
size: [100, 100]
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'red',
|
||||
width: 14
|
||||
@@ -81,7 +81,7 @@ describe('ol.render', function() {
|
||||
size: [100, 100]
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
lineCap: 'butt',
|
||||
color: 'red',
|
||||
@@ -106,7 +106,7 @@ describe('ol.render', function() {
|
||||
size: [100, 100]
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
lineJoin: 'bevel',
|
||||
color: 'red',
|
||||
@@ -131,7 +131,7 @@ describe('ol.render', function() {
|
||||
size: [100, 100]
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'blue',
|
||||
width: 8
|
||||
@@ -160,7 +160,7 @@ describe('ol.render', function() {
|
||||
size: [100, 100]
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
lineDash: [10, 5]
|
||||
})
|
||||
@@ -185,7 +185,7 @@ describe('ol.render', function() {
|
||||
size: [100, 100]
|
||||
});
|
||||
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
lineDash: [10, 5],
|
||||
lineDashOffset: 5
|
||||
|
||||
@@ -7,7 +7,7 @@ import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-20, 18]]) : new Point([-20, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 2,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -61,7 +61,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-10, 18]]) : new Point([-10, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 4,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -74,7 +74,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[4, 18]]) : new Point([4, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 6,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -87,7 +87,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-20, 3]]) : new Point([-20, 3])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 2,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -104,7 +104,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-10, 3]]) : new Point([-10, 3])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 4,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -121,7 +121,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[4, 3]]) : new Point([4, 3])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 6,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -138,7 +138,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-20, -15]]) : new Point([-20, -15])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 2,
|
||||
stroke: new _ol_style_Stroke_({
|
||||
@@ -152,7 +152,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-10, -15]]) : new Point([-10, -15])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 4,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -169,7 +169,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[4, -15]]) : new Point([4, -15])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 6,
|
||||
fill: new _ol_style_Fill_({
|
||||
|
||||
@@ -5,7 +5,7 @@ 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_Icon_ from '../../../../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
|
||||
|
||||
describe('ol.rendering.style.Icon', function() {
|
||||
@@ -58,7 +58,7 @@ describe('ol.rendering.style.Icon', function() {
|
||||
var img = new Image();
|
||||
img.onload = function() {
|
||||
imgInfo.img = img;
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_Icon_(/** @type {olx.style.IconOptions} */ (imgInfo))
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
@@ -4,7 +4,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_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
[[-20, 20], [15, 20]]
|
||||
)
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({color: '#DE213A', width: 3})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -58,7 +58,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
[[-20, 15], [15, 15]]
|
||||
)
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({color: '#9696EB', width: 1})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -68,9 +68,9 @@ describe('ol.rendering.style.LineString', function() {
|
||||
[[-20, 10], [15, 10]]
|
||||
)
|
||||
});
|
||||
feature.setStyle([new _ol_style_Style_({
|
||||
feature.setStyle([new Style({
|
||||
stroke: new _ol_style_Stroke_({color: '#F2F211', width: 5})
|
||||
}), new _ol_style_Style_({
|
||||
}), new Style({
|
||||
stroke: new _ol_style_Stroke_({color: '#292921', width: 1})
|
||||
})]);
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -80,7 +80,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
[[-20, -20], [-2, 0], [15, -20]]
|
||||
)
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#000000',
|
||||
width: 2,
|
||||
@@ -96,7 +96,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
[[-20, -15], [-2, 5], [15, -15]]
|
||||
)
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#000000',
|
||||
width: 2,
|
||||
|
||||
@@ -5,7 +5,7 @@ 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_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: fill
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -66,7 +66,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: fill
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -80,7 +80,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: fill
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -118,7 +118,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
stroke: stroke
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -131,7 +131,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
stroke: stroke
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -145,7 +145,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
stroke: stroke
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
@@ -178,7 +178,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-20, 10], [-20, 20], [-0, 20], [-0, 10], [-20, 10]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({color: '#E31E10'}),
|
||||
zIndex: 2
|
||||
}));
|
||||
@@ -190,7 +190,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-15, 5], [-15, 15], [5, 15], [5, 5], [-15, 5]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({color: '#1A5E42'}),
|
||||
zIndex: 3
|
||||
}));
|
||||
@@ -202,7 +202,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-10, 0], [-10, 10], [10, 10], [10, 0], [-10, 0]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({color: '#DEDE21'}),
|
||||
zIndex: 1
|
||||
}));
|
||||
@@ -235,7 +235,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({color: '#9696EB'}),
|
||||
stroke: new _ol_style_Stroke_({color: '#9696EB', width: 1})
|
||||
}));
|
||||
@@ -247,7 +247,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({color: 'rgba(255, 0, 0, 0.1)'}),
|
||||
stroke: new _ol_style_Stroke_({color: '#DE213A', width: 3})
|
||||
}));
|
||||
@@ -259,7 +259,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({color: 'rgba(18, 204, 105, 0.3)'}),
|
||||
stroke: new _ol_style_Stroke_({color: '#032E17', width: 2})
|
||||
}));
|
||||
@@ -321,7 +321,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
[[-20, -20], [-20, 20], [18, 20], [-20, -20]]
|
||||
])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
fill: new _ol_style_Fill_({color: createPattern()}),
|
||||
stroke: new _ol_style_Stroke_({color: createRainbowGradient(), width: 3})
|
||||
}));
|
||||
|
||||
@@ -6,7 +6,7 @@ import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_RegularShape_ from '../../../../src/ol/style/RegularShape.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
geometry: new Point([-15, 15])
|
||||
});
|
||||
// square
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
@@ -61,7 +61,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
geometry: new Point([8, 15])
|
||||
});
|
||||
// triangle
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
@@ -77,7 +77,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
geometry: new Point([-10, -8])
|
||||
});
|
||||
// star
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
@@ -93,7 +93,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
geometry: new Point([12, -8])
|
||||
});
|
||||
// cross
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
image: new _ol_style_RegularShape_({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
|
||||
@@ -10,7 +10,7 @@ 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 _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
|
||||
describe('ol.rendering.style.Text', function() {
|
||||
@@ -52,7 +52,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
feature = new Feature({
|
||||
geometry: new Point([-20, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
scale: scale,
|
||||
text: 'hello',
|
||||
@@ -64,7 +64,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
feature = new Feature({
|
||||
geometry: new Point([-10, 0])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
scale: scale,
|
||||
text: 'hello',
|
||||
@@ -83,7 +83,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
feature = new Feature({
|
||||
geometry: new Point([20, 10])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
scale: scale,
|
||||
rotateWithView: true,
|
||||
@@ -107,7 +107,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
function createLineString(coords, textAlign, maxAngle, strokeColor, strokeWidth, scale) {
|
||||
var geom = new LineString();
|
||||
geom.setFlatCoordinates('XY', coords);
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: 'red'
|
||||
}),
|
||||
@@ -176,7 +176,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
createMap('canvas');
|
||||
var feature;
|
||||
feature = new Feature(new Point([25, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nleft',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -185,7 +185,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new Feature(new Point([-25, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nright',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -194,7 +194,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new Feature(new Point([0, 25]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nbottom',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -203,7 +203,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new Feature(new Point([0, -25]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'top\nHello world',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -218,7 +218,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
createMap('canvas');
|
||||
var feature;
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nleft',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -228,7 +228,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nright',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -238,7 +238,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nbottom',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -248,7 +248,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'top\nHello world',
|
||||
font: 'bold 14px sans-serif',
|
||||
@@ -273,7 +273,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
line.translate(0, -100);
|
||||
geom.appendLineString(line);
|
||||
var feature = new Feature(geom);
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world',
|
||||
placement: 'line',
|
||||
@@ -290,7 +290,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
var geom = new Polygon(null);
|
||||
geom.setFlatCoordinates('XY', polygon, [polygon.length]);
|
||||
var feature = new Feature(geom);
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world',
|
||||
font: 'bold 24px sans-serif',
|
||||
@@ -316,7 +316,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
geom.translate(0, -60);
|
||||
multiPolygon.appendPolygon(geom);
|
||||
var feature = new Feature(multiPolygon);
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
feature.setStyle(new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world',
|
||||
font: 'bold 24px sans-serif',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Feature from '../../../src/ol/Feature.js';
|
||||
import Point from '../../../src/ol/geom/Point.js';
|
||||
import _ol_obj_ from '../../../src/ol/obj.js';
|
||||
import _ol_style_Style_ from '../../../src/ol/style/Style.js';
|
||||
import Style from '../../../src/ol/style/Style.js';
|
||||
|
||||
|
||||
describe('ol.Feature', function() {
|
||||
@@ -298,7 +298,7 @@ describe('ol.Feature', function() {
|
||||
|
||||
describe('#setStyle()', function() {
|
||||
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
var styleFunction = function(feature, resolution) {
|
||||
return resolution;
|
||||
@@ -355,7 +355,7 @@ describe('ol.Feature', function() {
|
||||
|
||||
describe('#getStyle()', function() {
|
||||
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
var styleFunction = function(resolution) {
|
||||
return null;
|
||||
@@ -403,7 +403,7 @@ describe('ol.Feature', function() {
|
||||
feature.setGeometryName('geom');
|
||||
var geometry = new Point([1, 2]);
|
||||
feature.setGeometry(geometry);
|
||||
var style = new _ol_style_Style_({});
|
||||
var style = new Style({});
|
||||
feature.setStyle(style);
|
||||
feature.set('barkey', 'barval');
|
||||
|
||||
@@ -448,7 +448,7 @@ describe('ol.Feature', function() {
|
||||
});
|
||||
|
||||
describe('ol.Feature.createStyleFunction()', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('creates a feature style function from a single style', function() {
|
||||
var styleFunction = Feature.createStyleFunction(style);
|
||||
|
||||
@@ -19,7 +19,7 @@ import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js';
|
||||
import IconAnchorUnits from '../../../../src/ol/style/IconAnchorUnits.js';
|
||||
import IconOrigin from '../../../../src/ol/style/IconOrigin.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../../../../src/ol/style/Text.js';
|
||||
import _ol_xml_ from '../../../../src/ol/xml.js';
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('ol.format.KML', function() {
|
||||
|
||||
describe('using defaultStyle', function() {
|
||||
|
||||
var dfltStyle = new _ol_style_Style_();
|
||||
var dfltStyle = new Style();
|
||||
|
||||
beforeEach(function() {
|
||||
format = new KML({
|
||||
@@ -61,7 +61,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style).to.be(dfltStyle);
|
||||
});
|
||||
});
|
||||
@@ -1719,7 +1719,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
|
||||
expect(style.getFill().getColor()).to.eql([255, 255, 255, 1]);
|
||||
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
|
||||
@@ -1752,7 +1752,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
|
||||
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
|
||||
var imageStyle = style.getImage();
|
||||
@@ -1832,7 +1832,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
|
||||
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
|
||||
var imageStyle = style.getImage();
|
||||
@@ -1903,7 +1903,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
|
||||
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
|
||||
var imageStyle = style.getImage();
|
||||
@@ -1939,7 +1939,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
|
||||
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
|
||||
expect(style.getStroke()).to.be(KML.DEFAULT_STROKE_STYLE_);
|
||||
@@ -1974,7 +1974,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(KML.DEFAULT_FILL_STYLE_);
|
||||
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
|
||||
var strokeStyle = style.getStroke();
|
||||
@@ -2006,7 +2006,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
var fillStyle = style.getFill();
|
||||
expect(fillStyle).to.be.an(_ol_style_Fill_);
|
||||
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
|
||||
@@ -2043,7 +2043,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
var fillStyle = style.getFill();
|
||||
expect(fillStyle).to.be.an(_ol_style_Fill_);
|
||||
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
|
||||
@@ -2082,7 +2082,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(null);
|
||||
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
|
||||
var strokeStyle = style.getStroke();
|
||||
@@ -2119,7 +2119,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
var fillStyle = style.getFill();
|
||||
expect(fillStyle).to.be.an(_ol_style_Fill_);
|
||||
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
|
||||
@@ -2157,7 +2157,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getFill()).to.be(null);
|
||||
expect(style.getImage()).to.be(KML.DEFAULT_IMAGE_STYLE_);
|
||||
expect(style.getStroke()).to.be(null);
|
||||
@@ -2210,7 +2210,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(2);
|
||||
var style = styleArray[1];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getText().getText()).to.eql(f.getProperties()['name']);
|
||||
});
|
||||
|
||||
@@ -2259,12 +2259,12 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(2);
|
||||
var style = styleArray[1];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
expect(style.getText().getText()).to.eql(f.getProperties()['name']);
|
||||
});
|
||||
|
||||
it('can write an feature\'s icon style', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
image: new _ol_style_Icon_({
|
||||
anchor: [0.25, 36],
|
||||
anchorOrigin: 'top-left',
|
||||
@@ -2313,7 +2313,7 @@ describe('ol.format.KML', function() {
|
||||
|
||||
it('does not write styles when writeStyles option is false', function() {
|
||||
format = new KML({writeStyles: false});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
image: new _ol_style_Icon_({
|
||||
src: 'http://foo.png'
|
||||
})
|
||||
@@ -2334,7 +2334,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('skips image styles that are not icon styles', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 4,
|
||||
fill: new _ol_style_Fill_({
|
||||
@@ -2360,7 +2360,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write an feature\'s text style', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
text: new _ol_style_Text_({
|
||||
scale: 0.5,
|
||||
text: 'foo',
|
||||
@@ -2392,7 +2392,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write an feature\'s stroke style', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#112233',
|
||||
width: 2
|
||||
@@ -2420,7 +2420,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write an feature\'s fill style', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(12, 34, 223, 0.7)'
|
||||
})
|
||||
@@ -2446,7 +2446,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write multiple features with Style', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: 'rgba(12, 34, 223, 0.7)'
|
||||
})
|
||||
@@ -2513,7 +2513,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var s = styleArray[0];
|
||||
expect(s).to.be.an(_ol_style_Style_);
|
||||
expect(s).to.be.an(Style);
|
||||
expect(s.getFill()).not.to.be(null);
|
||||
expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]);
|
||||
});
|
||||
@@ -2546,7 +2546,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var s = styleArray[0];
|
||||
expect(s).to.be.an(_ol_style_Style_);
|
||||
expect(s).to.be.an(Style);
|
||||
expect(s).to.be(KML.DEFAULT_STYLE_);
|
||||
|
||||
});
|
||||
@@ -2587,7 +2587,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var s = styleArray[0];
|
||||
expect(s).to.be.an(_ol_style_Style_);
|
||||
expect(s).to.be.an(Style);
|
||||
expect(s.getFill()).not.to.be(null);
|
||||
expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]);
|
||||
});
|
||||
@@ -2621,7 +2621,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var s = styleArray[0];
|
||||
expect(s).to.be.an(_ol_style_Style_);
|
||||
expect(s).to.be.an(Style);
|
||||
expect(s.getFill()).not.to.be(null);
|
||||
expect(s.getFill().getColor()).to.eql([0, 0, 0, 0]);
|
||||
});
|
||||
@@ -2655,7 +2655,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var s = styleArray[0];
|
||||
expect(s).to.be.an(_ol_style_Style_);
|
||||
expect(s).to.be.an(Style);
|
||||
expect(s).to.be(KML.DEFAULT_STYLE_);
|
||||
});
|
||||
|
||||
@@ -2689,7 +2689,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var s = styleArray[0];
|
||||
expect(s).to.be.an(_ol_style_Style_);
|
||||
expect(s).to.be.an(Style);
|
||||
expect(s.getFill()).not.to.be(null);
|
||||
expect(s.getFill().getColor()).to.eql([120, 86, 52, 18 / 255]);
|
||||
});
|
||||
@@ -2722,7 +2722,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
var fillStyle = style.getFill();
|
||||
expect(fillStyle).to.be.an(_ol_style_Fill_);
|
||||
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
|
||||
@@ -2754,7 +2754,7 @@ describe('ol.format.KML', function() {
|
||||
expect(styleArray).to.be.an(Array);
|
||||
expect(styleArray).to.have.length(1);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
var fillStyle = style.getFill();
|
||||
expect(fillStyle).to.be.an(_ol_style_Fill_);
|
||||
expect(fillStyle.getColor()).to.eql([0x78, 0x56, 0x34, 0x12 / 255]);
|
||||
@@ -3207,7 +3207,7 @@ describe('ol.format.KML', function() {
|
||||
var styleArray = styleFunction.call(f, 0);
|
||||
expect(styleArray).to.be.an(Array);
|
||||
var style = styleArray[0];
|
||||
expect(style).to.be.an(_ol_style_Style_);
|
||||
expect(style).to.be.an(Style);
|
||||
var imageStyle = style.getImage();
|
||||
expect(imageStyle).to.be.an(_ol_style_Icon_);
|
||||
expect(imageStyle.getSrc()).to.eql('http://maps.google.com/mapfiles/kml/shapes/star.png');
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import Layer from '../../../../src/ol/layer/Layer.js';
|
||||
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
|
||||
|
||||
describe('ol.layer.Vector', function() {
|
||||
|
||||
describe('constructor', function() {
|
||||
var source = new VectorSource();
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('creates a new layer', function() {
|
||||
var layer = new VectorLayer({source: source});
|
||||
@@ -58,7 +58,7 @@ describe('ol.layer.Vector', function() {
|
||||
layer = new VectorLayer({
|
||||
source: new VectorSource()
|
||||
});
|
||||
style = new _ol_style_Style_();
|
||||
style = new Style();
|
||||
});
|
||||
|
||||
it('allows the style to be set after construction', function() {
|
||||
@@ -74,10 +74,10 @@ describe('ol.layer.Vector', function() {
|
||||
});
|
||||
|
||||
it('updates the internal style function', function() {
|
||||
expect(layer.getStyleFunction()).to.be(_ol_style_Style_.defaultFunction);
|
||||
expect(layer.getStyleFunction()).to.be(Style.defaultFunction);
|
||||
layer.setStyle(style);
|
||||
expect(layer.getStyleFunction()).not.to.be(
|
||||
_ol_style_Style_.defaultFunction);
|
||||
Style.defaultFunction);
|
||||
});
|
||||
|
||||
it('allows setting an null style', function() {
|
||||
@@ -89,8 +89,8 @@ describe('ol.layer.Vector', function() {
|
||||
it('sets the default style when passing undefined', function() {
|
||||
layer.setStyle(style);
|
||||
layer.setStyle(undefined);
|
||||
expect(layer.getStyle()).to.be(_ol_style_Style_.defaultFunction);
|
||||
expect(layer.getStyleFunction()).to.be(_ol_style_Style_.defaultFunction);
|
||||
expect(layer.getStyle()).to.be(Style.defaultFunction);
|
||||
expect(layer.getStyleFunction()).to.be(Style.defaultFunction);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -98,14 +98,14 @@ describe('ol.layer.Vector', function() {
|
||||
describe('#getStyle()', function() {
|
||||
|
||||
var source = new VectorSource();
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('returns what is provided to setStyle', function() {
|
||||
var layer = new VectorLayer({
|
||||
source: source
|
||||
});
|
||||
|
||||
expect(layer.getStyle()).to.be(_ol_style_Style_.defaultFunction);
|
||||
expect(layer.getStyle()).to.be(Style.defaultFunction);
|
||||
|
||||
layer.setStyle(style);
|
||||
expect(layer.getStyle()).to.be(style);
|
||||
|
||||
@@ -11,7 +11,7 @@ import CanvasImmediateRenderer from '../../../../../src/ol/render/canvas/Immedia
|
||||
import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('ol.render.canvas.Immediate', function() {
|
||||
var stroke = new _ol_style_Stroke_({});
|
||||
var text = new _ol_style_Text_({});
|
||||
var image = new _ol_style_Circle_({});
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: fill,
|
||||
stroke: stroke,
|
||||
image: image,
|
||||
|
||||
@@ -15,13 +15,13 @@ import _ol_render_webgl_PolygonReplay_ from '../../../../../src/ol/render/webgl/
|
||||
import _ol_style_Circle_ from '../../../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../../src/ol/style/Style.js';
|
||||
|
||||
describe('ol.render.webgl.Immediate', function() {
|
||||
var context, style, circle, line, multiLine, point, multiPoint, polygon, multiPolygon;
|
||||
beforeEach(function() {
|
||||
context = new _ol_render_webgl_Immediate_({}, [0, 0], 0, 0, [0, 0], [-180, -90, 180, 90], 1);
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
image: new _ol_style_Circle_(),
|
||||
fill: new _ol_style_Fill_(),
|
||||
stroke: new _ol_style_Stroke_()
|
||||
|
||||
@@ -9,7 +9,7 @@ import CanvasLayerRenderer from '../../../../../src/ol/renderer/canvas/Layer.js'
|
||||
import CanvasMapRenderer from '../../../../../src/ol/renderer/canvas/Map.js';
|
||||
import VectorSource from '../../../../../src/ol/source/Vector.js';
|
||||
import _ol_style_Icon_ from '../../../../../src/ol/style/Icon.js';
|
||||
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../../src/ol/style/Style.js';
|
||||
|
||||
describe('ol.renderer.canvas.Map', function() {
|
||||
|
||||
@@ -58,7 +58,7 @@ describe('ol.renderer.canvas.Map', function() {
|
||||
})
|
||||
]
|
||||
}),
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
image: new _ol_style_Icon_({
|
||||
img: img,
|
||||
imgSize: [1, 1]
|
||||
|
||||
@@ -14,7 +14,7 @@ import _ol_render_canvas_ReplayGroup_ from '../../../../../src/ol/render/canvas/
|
||||
import _ol_renderer_vector_ from '../../../../../src/ol/renderer/vector.js';
|
||||
import _ol_style_Fill_ from '../../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../../src/ol/style/Style.js';
|
||||
import _ol_transform_ from '../../../../../src/ol/transform.js';
|
||||
|
||||
describe('ol.render.canvas.ReplayGroup', function() {
|
||||
@@ -37,17 +37,17 @@ describe('ol.render.canvas.ReplayGroup', function() {
|
||||
[[[90, 45], [90, 0], [0, 0], [0, 45], [90, 45]]]));
|
||||
feature3 = new Feature(new Polygon(
|
||||
[[[-90, -45], [-90, 45], [90, 45], [90, -45], [-90, -45]]]));
|
||||
fill0 = new _ol_style_Style_({
|
||||
fill0 = new Style({
|
||||
fill: new _ol_style_Fill_({color: 'black'})
|
||||
});
|
||||
fill1 = new _ol_style_Style_({
|
||||
fill1 = new Style({
|
||||
fill: new _ol_style_Fill_({color: 'red'})
|
||||
});
|
||||
style1 = new _ol_style_Style_({
|
||||
style1 = new Style({
|
||||
fill: new _ol_style_Fill_({color: 'black'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'white', width: 1})
|
||||
});
|
||||
style2 = new _ol_style_Style_({
|
||||
style2 = new Style({
|
||||
fill: new _ol_style_Fill_({color: 'white'}),
|
||||
stroke: new _ol_style_Stroke_({color: 'black', width: 1, lineDash: [3, 6],
|
||||
lineDashOffset: 2})
|
||||
@@ -216,7 +216,7 @@ describe('ol.render.canvas.ReplayGroup', function() {
|
||||
|
||||
it('calls the renderer function configured for the style', function() {
|
||||
var calls = [];
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
renderer: function(coords, state) {
|
||||
calls.push({
|
||||
coords: coords,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {get as getProjection} from '../../../../../src/ol/proj.js';
|
||||
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 _ol_style_Style_ from '../../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
|
||||
|
||||
|
||||
@@ -56,12 +56,12 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
}),
|
||||
target: target
|
||||
});
|
||||
var layerStyle = [new _ol_style_Style_({
|
||||
var layerStyle = [new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'layer'
|
||||
})
|
||||
})];
|
||||
var featureStyle = [new _ol_style_Style_({
|
||||
var featureStyle = [new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'feature'
|
||||
})
|
||||
@@ -93,7 +93,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
}),
|
||||
target: target
|
||||
});
|
||||
var layerStyle = new _ol_style_Style_({
|
||||
var layerStyle = new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'layer',
|
||||
font: '12px "Unavailable Font",sans-serif'
|
||||
@@ -124,7 +124,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
}),
|
||||
target: target
|
||||
});
|
||||
var layerStyle = new _ol_style_Style_({
|
||||
var layerStyle = new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'layer',
|
||||
font: '12px sans-serif'
|
||||
@@ -156,7 +156,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
}),
|
||||
target: target
|
||||
});
|
||||
var layerStyle = new _ol_style_Style_({
|
||||
var layerStyle = new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'layer',
|
||||
font: '12px "Droid Sans",sans-serif'
|
||||
|
||||
@@ -16,7 +16,7 @@ import _ol_render_canvas_ from '../../../../../src/ol/render/canvas.js';
|
||||
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 _ol_style_Style_ from '../../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
|
||||
import _ol_tilegrid_ from '../../../../../src/ol/tilegrid.js';
|
||||
|
||||
@@ -45,12 +45,12 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
||||
}),
|
||||
target: target
|
||||
});
|
||||
layerStyle = [new _ol_style_Style_({
|
||||
layerStyle = [new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'layer'
|
||||
})
|
||||
})];
|
||||
var featureStyle = [new _ol_style_Style_({
|
||||
var featureStyle = [new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'feature'
|
||||
})
|
||||
@@ -133,7 +133,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
||||
|
||||
it('renders replays with custom renderers as direct replays', function() {
|
||||
layer.renderMode_ = 'image';
|
||||
layer.setStyle(new _ol_style_Style_({
|
||||
layer.setStyle(new Style({
|
||||
renderer: function() {}
|
||||
}));
|
||||
var spy = sinon.spy(CanvasVectorTileLayerRenderer.prototype,
|
||||
@@ -216,7 +216,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
||||
it('works for multiple layers that use the same source', function() {
|
||||
var layer2 = new VectorTileLayer({
|
||||
source: source,
|
||||
style: new _ol_style_Style_({
|
||||
style: new Style({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'layer2'
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ import _ol_renderer_vector_ from '../../../../src/ol/renderer/vector.js';
|
||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Icon_ from '../../../../src/ol/style/Icon.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('ol.renderer.vector', function() {
|
||||
iconStyle = new _ol_style_Icon_({
|
||||
src: 'http://example.com/icon.png'
|
||||
});
|
||||
style = new _ol_style_Style_({
|
||||
style = new Style({
|
||||
image: iconStyle,
|
||||
fill: new _ol_style_Fill_({}),
|
||||
stroke: new _ol_style_Stroke_({})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import _ol_style_Style_ from '../../../../src/ol/style/Style.js';
|
||||
import Style from '../../../../src/ol/style/Style.js';
|
||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Circle_ from '../../../../src/ol/style/Circle.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
@@ -36,14 +36,14 @@ describe('ol.style.Style', function() {
|
||||
describe('#clone', function() {
|
||||
|
||||
it('creates a new ol.style.Style', function() {
|
||||
var original = new _ol_style_Style_();
|
||||
var original = new Style();
|
||||
var clone = original.clone();
|
||||
expect(clone).to.be.an(_ol_style_Style_);
|
||||
expect(clone).to.be.an(Style);
|
||||
expect(clone).to.not.be(original);
|
||||
});
|
||||
|
||||
it('copies all values', function() {
|
||||
var original = new _ol_style_Style_({
|
||||
var original = new Style({
|
||||
geometry: new Point([0, 0, 0]),
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
@@ -69,7 +69,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
it('the clone does not reference the same objects as the original', function() {
|
||||
var original = new _ol_style_Style_({
|
||||
var original = new Style({
|
||||
geometry: new Point([0, 0, 0]),
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
@@ -107,7 +107,7 @@ describe('ol.style.Style', function() {
|
||||
describe('#setZIndex', function() {
|
||||
|
||||
it('sets the zIndex', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
style.setZIndex(0.7);
|
||||
expect(style.getZIndex()).to.be(0.7);
|
||||
@@ -115,7 +115,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#getFill', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
fill: testFill
|
||||
});
|
||||
|
||||
@@ -125,7 +125,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#setFill', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('sets the fill style of a style', function() {
|
||||
style.setFill(testFill);
|
||||
@@ -134,7 +134,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#getImage', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
image: testImage
|
||||
});
|
||||
|
||||
@@ -144,7 +144,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#setImage', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('sets the image style of a style', function() {
|
||||
style.setImage(testImage);
|
||||
@@ -153,7 +153,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#getStroke', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
stroke: testStroke
|
||||
});
|
||||
|
||||
@@ -163,7 +163,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#setStroke', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('sets the stroke style of a style', function() {
|
||||
style.setStroke(testStroke);
|
||||
@@ -172,7 +172,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#getText', function() {
|
||||
var style = new _ol_style_Style_({
|
||||
var style = new Style({
|
||||
text: testText
|
||||
});
|
||||
|
||||
@@ -182,7 +182,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#setText', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('sets the text style of a style', function() {
|
||||
style.setText(testText);
|
||||
@@ -191,7 +191,7 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('#setGeometry', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('creates a geometry function from a string', function() {
|
||||
var feature = new Feature();
|
||||
@@ -221,7 +221,7 @@ describe('ol.style.Style', function() {
|
||||
describe('#getGeometry', function() {
|
||||
|
||||
it('returns whatever was passed to setGeometry', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
style.setGeometry('foo');
|
||||
expect(style.getGeometry()).to.eql('foo');
|
||||
var geom = new Point([1, 2]);
|
||||
@@ -241,15 +241,15 @@ describe('ol.style.Style', function() {
|
||||
});
|
||||
|
||||
describe('ol.style.Style.createFunction()', function() {
|
||||
var style = new _ol_style_Style_();
|
||||
var style = new Style();
|
||||
|
||||
it('creates a style function from a single style', function() {
|
||||
var styleFunction = _ol_style_Style_.createFunction(style);
|
||||
var styleFunction = Style.createFunction(style);
|
||||
expect(styleFunction()).to.eql([style]);
|
||||
});
|
||||
|
||||
it('creates a style function from an array of styles', function() {
|
||||
var styleFunction = _ol_style_Style_.createFunction([style]);
|
||||
var styleFunction = Style.createFunction([style]);
|
||||
expect(styleFunction()).to.eql([style]);
|
||||
});
|
||||
|
||||
@@ -257,13 +257,13 @@ describe('ol.style.Style.createFunction()', function() {
|
||||
var original = function() {
|
||||
return [style];
|
||||
};
|
||||
var styleFunction = _ol_style_Style_.createFunction(original);
|
||||
var styleFunction = Style.createFunction(original);
|
||||
expect(styleFunction).to.be(original);
|
||||
});
|
||||
|
||||
it('throws on (some) unexpected input', function() {
|
||||
expect(function() {
|
||||
_ol_style_Style_.createFunction({bogus: 'input'});
|
||||
Style.createFunction({bogus: 'input'});
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user