ThinkGeo.com    |     Documentation    |     Premium Support

MarkerOverlay Under HighlightOverlay

I don't know if I am missing something. I created a markeroverlay and highlightoverlay. I am using the markers to be the center point of the highlightoverlayer and popup info about it. The markers seem to be rendering underneath the highlightlayer and I can't mouse over to show the popups. Any suggestions?


 


Thanks in advance,


Cruz



Cruz,  
  
 Thanks for pointing out this problem! You are right it is a bug and we’ll fix it in the coming version.  For now please use the following code to work around, the index number might be changed in your scenario. 
  
 
    function OnMapCreated(map) {
        var markerOverlay = map.getLayersByName("MarkerOverlay")[0];
        map.setLayerIndex(markerOverlay, 2);

        if (map.getLayersByName("HighlightOverlay").length > 0) {
            var highlightOverlay = map.getLayersByName("HighlightOverlay")[0];
            map.setLayerIndex(highlightOverlay, 1);
        }

        map.resetLayersZIndex();
    }
 
  
 Thanks, 
  
 Ben