Switch map and layer constructor in tests

The webgl tests do not run currently (which is why these have not been failing).
This commit is contained in:
Tim Schaub
2018-11-04 20:29:54 -07:00
parent ca5b0c63a5
commit a69eeceeba
14 changed files with 122 additions and 89 deletions

View File

@@ -2,8 +2,10 @@ 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';
import WebGLMap from '../../../../src/ol/WebGLMap.js';
import View from '../../../../src/ol/View.js';
import VectorLayer from '../../../../src/ol/layer/Vector.js';
import WebGLVectorLayer from '../../../../src/ol/layer/Vector.js';
import VectorSource from '../../../../src/ol/source/Vector.js';
import CircleStyle from '../../../../src/ol/style/Circle.js';
import Fill from '../../../../src/ol/style/Fill.js';
@@ -16,15 +18,17 @@ describe('ol.rendering.style.Circle', function() {
let map, vectorSource;
function createMap(renderer) {
const MapConstructor = renderer === 'webgl' ? WebGLMap : Map;
const LayerConstructor = renderer === 'webgl' ? WebGLVectorLayer : VectorLayer;
vectorSource = new VectorSource();
const vectorLayer = new VectorLayer({
const vectorLayer = new LayerConstructor({
source: vectorSource
});
map = new Map({
map = new MapConstructor({
pixelRatio: 1,
target: createMapDiv(50, 50),
renderer: renderer,
layers: [vectorLayer],
view: new View({
projection: 'EPSG:4326',