[OpenLayers-Users] OpenLayers.Handler.Box interrupted by custom div

advance feng_gongyu at 163.com
Tue Aug 10 05:57:38 EDT 2010


hi list, i have a problem about OpenLayers.Handler.Box
i Holding the SHIFT and draw a box ,when the icon move over a custom div
,the box is interrupted by the div,i think this is because zIndex,i set many
value to zIndex but not solve the problem,
the custom div is like:
    var id = OpenLayers.Util.createUniqueID("myCarLabel_" + this.portId);
    var div = OpenLayers.Util.createDiv(id, null, null, null, null, null,
"hidden");
    div.className = 'olPopup';
    div.style.zIndex = 0;
    var groupDiv = OpenLayers.Util.createDiv(null, null, null, null,
"relative", null, "hidden");

    var id = div.id + "_contentDiv";
    var divSize = new OpenLayers.Size(137, 22); // 宽,高
    var contentDiv = OpenLayers.Util.createDiv(id, null, divSize, null,
"relative", null, "hidden");
    contentDiv.className = 'olPopupContent';
    contentDiv.innerHTML = this.pointName;
    contentDiv.style.fontFamily = "sans-serif";
    contentDiv.style.fontWeight = "bold";
    contentDiv.style.marginTop = "-6px";
    contentDiv.style.marginLeft = "-6px";
    contentDiv.style.zIndex = 0;
    OpenLayers.Event.observe(contentDiv, "mouseover",
            OpenLayers.Function.bindAsEventListener(function() {
contentDiv.style.zIndex = 1; contentDiv.style.backgroundColor = '#C6E3FF';
}, contentDiv)
        );
    OpenLayers.Event.observe(contentDiv, "mouseout",
            OpenLayers.Function.bindAsEventListener(function() {
contentDiv.style.zIndex = 0; contentDiv.style.backgroundColor =
'transparent'; }, contentDiv)
        );

    groupDiv.appendChild(contentDiv);
    div.appendChild(groupDiv);
    
    document.body.insertAdjacentElement('BeforeEnd', div);

    return div;

both of them interrupt  the box,please help me !,many thanks~~~~~~
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Handler-Box-interrupted-by-custom-div-tp5392395p5392395.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100810/ad9a84fc/attachment.html


More information about the Users mailing list