通过setBaseLayer和setVisibility
/**
* 控制地图显示
*/
function layerVisibilityTrue(layerName){
layerName.setVisibility(true);
}
/**
* 控制地图隐藏
*/
function layerVisibilityFalse(layerName){
layerName.setVisibility(false);
}
/**
* map底图设置
*/
function baseLayerSet(layerName){
map.setBaseLayer(layerName);
}
/**
* map图层顺序控制
*/
function layerIndexSet(layerName){
map.setLayerIndex(layerName,0);
}
//地图切换,从world切换为china
layerSwitchChina:function (){
imap.baseLayerSet(layerChina)
},
layerSwitchWorld:function (){
imap.baseLayerSet(layerWorld)
},