我想向帶有開放層的地圖添加兩個額外的按鈕。用我的代碼只顯示第一個按鈕?什麼是錯在這裏?:在openlayers地圖上水平添加兩個自定義按鈕
.olControlButton1ItemActive {
position: absolute;
background-image: url(add_blue.png);
top: 0;
right: 0;
width: 18px;
height: 18px;
}
.olControlButton2ItemActive {
position: absolute;
background-image: url(minus_blue.png);
top: 18;
right: 0;
width: 18px;
height: 18px;
}
.olControlPanel {
border: 1px solid black;
top: 70px;
left: 12px;
width: 18px;
height: 36px;
position: absolute;
cursor: pointer;
}
....
map.setCenter (lonLat, zoom);
var button1 = new OpenLayers.Control.Button ({displayClass: 'olControlButton1', trigger: button1Clicked, title: 'Button is to be clicked'});
var button2 = new OpenLayers.Control.Button ({displayClass: 'olControlButton2', trigger: button2Clicked, title: 'Button is to be clicked'});
panel = new OpenLayers.Control.Panel({defaultControl: button1});
panel.addControls([button1,button2]);
map.addControl (panel);
嗨,這不是問題:Button2不呈現給面板:-( – fillibuster
如何做類'olControlButton1'和'olControlButton2'看起來像? – igorti
嗨,上面的源代碼是這個時候的一切。 – fillibuster