2013-07-11 60 views

回答

0

呼叫hideAllOverlaysshowAllOverlays從按鈕的回調。

// UNTESTED 
function setAllOverlaysVisibility(map, status) { 
    var layers = map.layers; 
    for (var i = 0; i<layers.length; ++i) { 
     var layer = layers[i]; 
     if (!layer.isBaseLayer) { 
      layer.setVisiblity(status); 
     } 
    } 
} 

function hideAllOverlays(map) { 
    setAllOverlaysVisibility(map, false); 
} 

function showAllOverlays(map) { 
    setAllOverlaysVisibility(map, true); 
} 
相關問題