您可以使用 jQuery 来制作zindex
类似这样的技巧
clientesLayer = new OpenLayers.Layer.Vector("PuntosVentas");
feature = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(vectorFatri.puntos[index][0],vectorFatri.puntos[index][1]),
{description: '<div><div class="popup_title"><h4>'+vectorFatri.imei+'</h4></div><div class="popup_content">'+vectorFatri.fecha[index]+'</div></div>'} ,
{
strokeColor: "#00FF00",
strokeOpacity: 1,
strokeWidth: 2,
fillColor: "#FF5500",
fillOpacity: 0.5,
pointRadius: 6,
pointerEvents: "visiblePainted"
}
);
controls = {
selector: new OpenLayers.Control.SelectFeature(clientesLayer, {
onSelect: function (feature) {
feature.popup = new OpenLayers.Popup.FramedCloud("pop",
feature.geometry.getBounds().getCenterLonLat(),
new OpenLayers.Size(300,200),
'<div class="markerContent">'+feature.attributes.description+'</div>',
null,
true,
function() { controls['selector'].unselectAll(); }
);
map.addPopup(feature.popup);
{# console.log('me seleccionaron');#}
//jquery trick to make the popup front of everything
$(".olPopup").css("z-index", 10000)
{# setTimeout(function(){$(".olPopup").css("z-index", 10000);}, 2000);#}
},
onUnselect: function (feature) {
map.removePopup(feature.popup);
feature.popup.destroy();
feature.popup = null;
}
})
}
map.addControl(controls['selector']);
controls['selector'].activate();
clientesLayer.addFeatures(feature);