Rename _ol_Feature_ to Feature
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../../src/ol/View.js';
|
||||
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
|
||||
@@ -42,11 +42,11 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
var source;
|
||||
|
||||
function addCircle(r) {
|
||||
source.addFeature(new _ol_Feature_(new Circle(center, r)));
|
||||
source.addFeature(new Feature(new Circle(center, r)));
|
||||
}
|
||||
|
||||
function addPolygon(r) {
|
||||
source.addFeature(new _ol_Feature_(new Polygon([
|
||||
source.addFeature(new Feature(new Polygon([
|
||||
[
|
||||
[center[0] - r, center[1] - r],
|
||||
[center[0] + r, center[1] - r],
|
||||
@@ -58,7 +58,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
}
|
||||
|
||||
function addLineString(r) {
|
||||
source.addFeature(new _ol_Feature_(new LineString([
|
||||
source.addFeature(new Feature(new LineString([
|
||||
[center[0] - r, center[1] - r],
|
||||
[center[0] + r, center[1] - r],
|
||||
[center[0] + r, center[1] + r],
|
||||
@@ -75,7 +75,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
it('renders opacity correctly with the canvas renderer', function(done) {
|
||||
createMap('canvas');
|
||||
var smallLine = new _ol_Feature_(new LineString([
|
||||
var smallLine = new Feature(new LineString([
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
@@ -101,7 +101,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
it('renders opacity correctly with renderMode: \'image\'', function(done) {
|
||||
createMap('canvas');
|
||||
var smallLine = new _ol_Feature_(new LineString([
|
||||
var smallLine = new Feature(new LineString([
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
@@ -128,7 +128,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
it('renders transparent layers correctly with the canvas renderer', function(done) {
|
||||
createMap('canvas');
|
||||
var smallLine = new _ol_Feature_(new LineString([
|
||||
var smallLine = new Feature(new LineString([
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
@@ -141,7 +141,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
})
|
||||
]);
|
||||
source.addFeature(smallLine);
|
||||
var smallLine2 = new _ol_Feature_(new LineString([
|
||||
var smallLine2 = new Feature(new LineString([
|
||||
[center[0], center[1] - 1000],
|
||||
[center[0], center[1] + 1000]
|
||||
]));
|
||||
@@ -167,7 +167,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
|
||||
it('renders transparent layers correctly with renderMode: \'image\'', function(done) {
|
||||
createMap('canvas');
|
||||
var smallLine = new _ol_Feature_(new LineString([
|
||||
var smallLine = new Feature(new LineString([
|
||||
[center[0], center[1] - 1],
|
||||
[center[0], center[1] + 1]
|
||||
]));
|
||||
@@ -180,7 +180,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
})
|
||||
]);
|
||||
source.addFeature(smallLine);
|
||||
var smallLine2 = new _ol_Feature_(new LineString([
|
||||
var smallLine2 = new Feature(new LineString([
|
||||
[center[0], center[1] - 1000],
|
||||
[center[0], center[1] + 1000]
|
||||
]));
|
||||
@@ -494,14 +494,14 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
beforeEach(function() {
|
||||
var src = new _ol_source_Vector_({
|
||||
features: [
|
||||
new _ol_Feature_(new Polygon([[
|
||||
new Feature(new Polygon([[
|
||||
[-22, 58],
|
||||
[-22, 78],
|
||||
[-9, 78],
|
||||
[-9, 58],
|
||||
[-22, 58]
|
||||
]])),
|
||||
new _ol_Feature_(new Polygon([[
|
||||
new Feature(new Polygon([[
|
||||
[-9, 58],
|
||||
[-9, 78],
|
||||
[4, 78],
|
||||
@@ -589,16 +589,16 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
var centerFeature = new _ol_Feature_({
|
||||
var centerFeature = new Feature({
|
||||
geometry: new Point(center),
|
||||
text: 'center'
|
||||
});
|
||||
source.addFeature(centerFeature);
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] - 540, center[1]]),
|
||||
text: 'west'
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] + 540, center[1]]),
|
||||
text: 'east'
|
||||
}));
|
||||
@@ -630,16 +630,16 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
var centerFeature = new _ol_Feature_({
|
||||
var centerFeature = new Feature({
|
||||
geometry: new Point(center),
|
||||
text: 'center'
|
||||
});
|
||||
source.addFeature(centerFeature);
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] - 540, center[1]]),
|
||||
text: 'west'
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] + 540, center[1]]),
|
||||
text: 'east'
|
||||
}));
|
||||
@@ -670,17 +670,17 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point(center),
|
||||
text: 'center',
|
||||
zIndex: 2
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] - 540, center[1]]),
|
||||
text: 'west',
|
||||
zIndex: 3
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] + 540, center[1]]),
|
||||
text: 'east',
|
||||
zIndex: 1
|
||||
@@ -710,14 +710,14 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
var centerFeature = new _ol_Feature_({
|
||||
var centerFeature = new Feature({
|
||||
geometry: new Point(center)
|
||||
});
|
||||
source.addFeature(centerFeature);
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] - 540, center[1]])
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] + 540, center[1]])
|
||||
}));
|
||||
|
||||
@@ -750,14 +750,14 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
var centerFeature = new _ol_Feature_({
|
||||
var centerFeature = new Feature({
|
||||
geometry: new Point(center)
|
||||
});
|
||||
source.addFeature(centerFeature);
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] - 540, center[1]])
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] + 540, center[1]])
|
||||
}));
|
||||
|
||||
@@ -789,15 +789,15 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point(center),
|
||||
zIndex: 2
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] - 540, center[1]]),
|
||||
zIndex: 3
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] + 540, center[1]]),
|
||||
zIndex: 1
|
||||
}));
|
||||
@@ -828,15 +828,15 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point(center),
|
||||
text: 'center'
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] - 540, center[1]]),
|
||||
text: 'west'
|
||||
}));
|
||||
source.addFeature(new _ol_Feature_({
|
||||
source.addFeature(new Feature({
|
||||
geometry: new Point([center[0] + 540, center[1]]),
|
||||
text: 'east'
|
||||
}));
|
||||
@@ -872,7 +872,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
var point = new _ol_Feature_(new Point(center));
|
||||
var point = new Feature(new Point(center));
|
||||
point.setStyle(new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 8,
|
||||
@@ -881,7 +881,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
})
|
||||
})
|
||||
}));
|
||||
var line = new _ol_Feature_(new LineString([
|
||||
var line = new Feature(new LineString([
|
||||
[center[0] - 650, center[1] - 200],
|
||||
[center[0] + 650, center[1] - 200]
|
||||
]));
|
||||
@@ -915,7 +915,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
var point = new _ol_Feature_(new Point(center));
|
||||
var point = new Feature(new Point(center));
|
||||
point.setStyle(new _ol_style_Style_({
|
||||
image: new _ol_style_Circle_({
|
||||
radius: 8,
|
||||
@@ -924,7 +924,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
})
|
||||
})
|
||||
}));
|
||||
var line = new _ol_Feature_(new LineString([
|
||||
var line = new Feature(new LineString([
|
||||
[center[0] - 650, center[1] - 200],
|
||||
[center[0] + 650, center[1] - 200]
|
||||
]));
|
||||
@@ -958,7 +958,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
var point = new _ol_Feature_(new Point(center));
|
||||
var point = new Feature(new Point(center));
|
||||
point.setStyle(new _ol_style_Style_({
|
||||
zIndex: 2,
|
||||
image: new _ol_style_Circle_({
|
||||
@@ -968,7 +968,7 @@ describe('ol.rendering.layer.Vector', function() {
|
||||
})
|
||||
})
|
||||
}));
|
||||
var line = new _ol_Feature_(new LineString([
|
||||
var line = new Feature(new LineString([
|
||||
[center[0] - 650, center[1] - 200],
|
||||
[center[0] + 650, center[1] - 200]
|
||||
]));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../../src/ol/View.js';
|
||||
import MVT from '../../../../src/ol/format/MVT.js';
|
||||
@@ -98,7 +98,7 @@ describe('ol.rendering.layer.VectorTile', function() {
|
||||
createMap('canvas');
|
||||
var vectorSource = new _ol_source_Vector_({
|
||||
features: [
|
||||
new _ol_Feature_(new Point([1825727.7316762917, 6143091.089223046]))
|
||||
new Feature(new Point([1825727.7316762917, 6143091.089223046]))
|
||||
]
|
||||
});
|
||||
map.addLayer(new _ol_layer_Vector_({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../src/ol/Feature.js';
|
||||
import Feature from '../../../src/ol/Feature.js';
|
||||
import Point from '../../../src/ol/geom/Point.js';
|
||||
import Map from '../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../src/ol/View.js';
|
||||
@@ -12,7 +12,7 @@ describe('ol.rendering.Map', function() {
|
||||
function createMap(renderer) {
|
||||
var vectorLayer = new _ol_layer_Vector_({
|
||||
source: new _ol_source_Vector_({
|
||||
features: [new _ol_Feature_({
|
||||
features: [new Feature({
|
||||
geometry: new Point([0, 0])
|
||||
})]
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
@@ -45,7 +45,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
|
||||
function createFeatures(multi) {
|
||||
var feature;
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-20, 18]]) : new Point([-20, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -58,7 +58,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-10, 18]]) : new Point([-10, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -71,7 +71,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[4, 18]]) : new Point([4, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -84,7 +84,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-20, 3]]) : new Point([-20, 3])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -101,7 +101,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-10, 3]]) : new Point([-10, 3])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -118,7 +118,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[4, 3]]) : new Point([4, 3])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -135,7 +135,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-20, -15]]) : new Point([-20, -15])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -149,7 +149,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[-10, -15]]) : new Point([-10, -15])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -166,7 +166,7 @@ describe('ol.rendering.style.Circle', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: multi ? new MultiPoint([[4, -15]]) : new Point([4, -15])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../../src/ol/View.js';
|
||||
@@ -51,7 +51,7 @@ describe('ol.rendering.style.Icon', function() {
|
||||
|
||||
function createFeatures(src, imgInfo, callback) {
|
||||
var feature;
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([0, 0])
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../../src/ol/View.js';
|
||||
@@ -43,7 +43,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
function createFeatures() {
|
||||
var feature;
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new LineString(
|
||||
[[-20, 20], [15, 20]]
|
||||
)
|
||||
@@ -53,7 +53,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new LineString(
|
||||
[[-20, 15], [15, 15]]
|
||||
)
|
||||
@@ -63,7 +63,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new LineString(
|
||||
[[-20, 10], [15, 10]]
|
||||
)
|
||||
@@ -75,7 +75,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
})]);
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new LineString(
|
||||
[[-20, -20], [-2, 0], [15, -20]]
|
||||
)
|
||||
@@ -91,7 +91,7 @@ describe('ol.rendering.style.LineString', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new LineString(
|
||||
[[-20, -15], [-2, 5], [15, -15]]
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../../src/ol/View.js';
|
||||
@@ -48,7 +48,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
|
||||
var feature;
|
||||
// rectangle
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
|
||||
])
|
||||
@@ -59,7 +59,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with 1 hole
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]],
|
||||
[[5, 13], [10, 13], [10, 17], [5, 17], [5, 13]]
|
||||
@@ -72,7 +72,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with 2 holes
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]],
|
||||
[[-18, -18], [-12, -18], [-12, -12], [-18, -12], [-18, -18]],
|
||||
@@ -113,7 +113,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
|
||||
var feature;
|
||||
// rectangle
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
|
||||
])
|
||||
@@ -124,7 +124,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with 1 hole
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[0, 10], [0, 20], [20, 20], [20, 10], [0, 10]],
|
||||
[[5, 13], [10, 13], [10, 17], [5, 17], [5, 13]]
|
||||
@@ -137,7 +137,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with 2 holes
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, -20], [-20, 5], [20, 5], [20, -20], [-20, -20]],
|
||||
[[-12, -3], [-12, -12], [-8, -12], [-8, -3], [-12, -3]],
|
||||
@@ -173,7 +173,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
function createFeatures() {
|
||||
var feature;
|
||||
// rectangle with z-index 2
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, 10], [-20, 20], [-0, 20], [-0, 10], [-20, 10]]
|
||||
])
|
||||
@@ -185,7 +185,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with z-index 3
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-15, 5], [-15, 15], [5, 15], [5, 5], [-15, 5]]
|
||||
])
|
||||
@@ -197,7 +197,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with z-index 1
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-10, 0], [-10, 10], [10, 10], [10, 0], [-10, 0]]
|
||||
])
|
||||
@@ -230,7 +230,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
function createFeatures() {
|
||||
var feature;
|
||||
// rectangle
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, 10], [-20, 20], [-5, 20], [-5, 10], [-20, 10]]
|
||||
])
|
||||
@@ -242,7 +242,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with 1 hole
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[0, 10], [0, 20], [15, 20], [15, 10], [0, 10]]
|
||||
])
|
||||
@@ -254,7 +254,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
// rectangle with 2 holes
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, -20], [-20, 5], [15, 5], [15, -20], [-20, -20]]
|
||||
])
|
||||
@@ -316,7 +316,7 @@ describe('ol.rendering.style.Polygon', function() {
|
||||
}
|
||||
|
||||
function createFeatures() {
|
||||
var feature = new _ol_Feature_({
|
||||
var feature = new Feature({
|
||||
geometry: new Polygon([
|
||||
[[-20, -20], [-20, 20], [18, 20], [-20, -20]]
|
||||
])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import _ol_View_ from '../../../../src/ol/View.js';
|
||||
@@ -42,7 +42,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
|
||||
function createFeatures(stroke, fill) {
|
||||
var feature;
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([-15, 15])
|
||||
});
|
||||
// square
|
||||
@@ -57,7 +57,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([8, 15])
|
||||
});
|
||||
// triangle
|
||||
@@ -73,7 +73,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([-10, -8])
|
||||
});
|
||||
// star
|
||||
@@ -89,7 +89,7 @@ describe('ol.rendering.style.RegularShape', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([12, -8])
|
||||
});
|
||||
// cross
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||
@@ -49,7 +49,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
function createFeatures(opt_scale) {
|
||||
var scale = opt_scale || 1;
|
||||
var feature;
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([-20, 18])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -61,7 +61,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([-10, 0])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -80,7 +80,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
feature = new _ol_Feature_({
|
||||
feature = new Feature({
|
||||
geometry: new Point([20, 10])
|
||||
});
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
@@ -124,13 +124,13 @@ describe('ol.rendering.style.Text', function() {
|
||||
})
|
||||
})
|
||||
});
|
||||
var feature = new _ol_Feature_(geom);
|
||||
var feature = new Feature(geom);
|
||||
feature.setStyle(style);
|
||||
vectorSource.addFeature(feature);
|
||||
|
||||
geom = geom.clone();
|
||||
geom.translate(0, 5);
|
||||
feature = new _ol_Feature_(geom);
|
||||
feature = new Feature(geom);
|
||||
style = style.clone();
|
||||
style.getText().setTextBaseline('top');
|
||||
feature.setStyle(style);
|
||||
@@ -138,7 +138,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
|
||||
geom = geom.clone();
|
||||
geom.translate(0, -10);
|
||||
feature = new _ol_Feature_(geom);
|
||||
feature = new Feature(geom);
|
||||
style = style.clone();
|
||||
style.getText().setTextBaseline('bottom');
|
||||
feature.setStyle(style);
|
||||
@@ -175,7 +175,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
it('renders multiline text with alignment options', function(done) {
|
||||
createMap('canvas');
|
||||
var feature;
|
||||
feature = new _ol_Feature_(new Point([25, 0]));
|
||||
feature = new Feature(new Point([25, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nleft',
|
||||
@@ -184,7 +184,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new _ol_Feature_(new Point([-25, 0]));
|
||||
feature = new Feature(new Point([-25, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nright',
|
||||
@@ -193,7 +193,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new _ol_Feature_(new Point([0, 25]));
|
||||
feature = new Feature(new Point([0, 25]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nbottom',
|
||||
@@ -202,7 +202,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new _ol_Feature_(new Point([0, -25]));
|
||||
feature = new Feature(new Point([0, -25]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'top\nHello world',
|
||||
@@ -217,7 +217,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
it('renders multiline text with positioning options', function(done) {
|
||||
createMap('canvas');
|
||||
var feature;
|
||||
feature = new _ol_Feature_(new Point([0, 0]));
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nleft',
|
||||
@@ -227,7 +227,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new _ol_Feature_(new Point([0, 0]));
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nright',
|
||||
@@ -237,7 +237,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new _ol_Feature_(new Point([0, 0]));
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world\nbottom',
|
||||
@@ -247,7 +247,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
})
|
||||
}));
|
||||
vectorSource.addFeature(feature);
|
||||
feature = new _ol_Feature_(new Point([0, 0]));
|
||||
feature = new Feature(new Point([0, 0]));
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'top\nHello world',
|
||||
@@ -272,7 +272,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
line = line.clone();
|
||||
line.translate(0, -100);
|
||||
geom.appendLineString(line);
|
||||
var feature = new _ol_Feature_(geom);
|
||||
var feature = new Feature(geom);
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world',
|
||||
@@ -289,7 +289,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
createMap('canvas');
|
||||
var geom = new Polygon(null);
|
||||
geom.setFlatCoordinates('XY', polygon, [polygon.length]);
|
||||
var feature = new _ol_Feature_(geom);
|
||||
var feature = new Feature(geom);
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world',
|
||||
@@ -315,7 +315,7 @@ describe('ol.rendering.style.Text', function() {
|
||||
geom = geom.clone();
|
||||
geom.translate(0, -60);
|
||||
multiPolygon.appendPolygon(geom);
|
||||
var feature = new _ol_Feature_(multiPolygon);
|
||||
var feature = new Feature(multiPolygon);
|
||||
feature.setStyle(new _ol_style_Style_({
|
||||
text: new _ol_style_Text_({
|
||||
text: 'Hello world',
|
||||
|
||||
Reference in New Issue
Block a user