Is there a method to change Z-indexes of layers in OpenLayers3 like it was in old version?
map.setLayerIndex(markers, 99); //set the marker layer to an arbitrarily high layer index
I need to change order of layers throughout using a map. So such possibility as defining z-index like this do not help
var geoLayer = new ol.layer.Vector({
source : new ol.source.GeoJSON({
projection : 'EPSG:900913',
url : './myGeoJson.json'
}),
style : function(feature, resolution) {
var text = resolution < 5000 ? feature.get('name') : '';
if (!styleCache[text]) {
styleCache[text] = [new ol.style.Style({
fill : new ol.style.Fill({
color : 'rgba(255, 255, 255, 0.1)'
}),
stroke : new ol.style.Stroke({
color : '#319FD3',
width : 1
}),
text : new ol.style.Text({
font : '12px Calibri,sans-serif',
text : text,
fill : new ol.style.Fill({
color : '#000'
}),
stroke : new ol.style.Stroke({
color : '#fff',
width : 3
})
}),
zIndex : 999
})];
}
}
});