Fix zIndex handling for unmanaged layers

This commit is contained in:
ahocevar
2019-05-05 13:16:28 +02:00
parent 6cfd0b70ed
commit ba6ac43a28
5 changed files with 17 additions and 11 deletions

View File

@@ -4,8 +4,10 @@ import {Vector as VectorLayer, Tile as TileLayer} from '../../../src/ol/layer.js
import {Vector as VectorSource, XYZ} from '../../../src/ol/source.js';
import GeoJSON from '../../../src/ol/format/GeoJSON.js';
import {Style, Stroke} from '../../../src/ol/style.js';
import Feature from '../../../src/ol/Feature.js';
import Point from '../../../src/ol/geom/Point.js';
new Map({
const map = new Map({
layers: [
new TileLayer({
source: new XYZ({
@@ -14,6 +16,7 @@ new Map({
})
}),
new VectorLayer({
zIndex: 1,
style: new Style({
stroke: new Stroke({
color: 'rgba(255,255,255,0.5)',
@@ -33,4 +36,11 @@ new Map({
})
});
const unmanaged = new VectorLayer({
source: new VectorSource({
features: [new Feature(new Point([0, 0]))]
})
});
unmanaged.setMap(map);
render();