您好所有,我創建的OpenLayers瀏覽器中的窗體,部署在同樣的方式,切換地圖。形式在觀衆的OpenLayers
看到此鏈接: http://www.youtube.com/watch?v=bb0JqmZW7S4
感謝任何迴應
您好所有,我創建的OpenLayers瀏覽器中的窗體,部署在同樣的方式,切換地圖。形式在觀衆的OpenLayers
看到此鏈接: http://www.youtube.com/watch?v=bb0JqmZW7S4
感謝任何迴應
我覺得OP想做的事,是通過類似於在默認訪問鷹眼/ LayerSwitcher一個按鈕來訪問他的自定義窗體的OpenLayers。
如何做到這一點可以從如何鷹眼控制*實現提取:
this.div.className += " " + this.displayClass + 'Container';
var imgLocation = OpenLayers.Util.getImagesLocation();
// maximize button div
var img = imgLocation + 'layer-switcher-maximize.png';
this.maximizeDiv = OpenLayers.Util.createAlphaImageDiv(
this.displayClass + 'MaximizeButton',
null,
new OpenLayers.Size(18,18),
img,
'absolute');
this.maximizeDiv.style.display = 'none';
this.maximizeDiv.className = this.displayClass + 'MaximizeButton';
OpenLayers.Event.observe(this.maximizeDiv, 'click',
OpenLayers.Function.bindAsEventListener(this.maximizeControl,
this)
);
this.div.appendChild(this.maximizeDiv);
// minimize button div
var img = imgLocation + 'layer-switcher-minimize.png';
this.minimizeDiv = OpenLayers.Util.createAlphaImageDiv(
'OpenLayers_Control_minimizeDiv',
null,
new OpenLayers.Size(18,18),
img,
'absolute');
this.minimizeDiv.style.display = 'none';
this.minimizeDiv.className = this.displayClass + 'MinimizeButton';
OpenLayers.Event.observe(this.minimizeDiv, 'click',
OpenLayers.Function.bindAsEventListener(this.minimizeControl,
this)
);
this.div.appendChild(this.minimizeDiv);
var eventsToStop = ['dblclick','mousedown'];
for (var i=0, len=eventsToStop.length; i<len; i++) {
OpenLayers.Event.observe(this.maximizeDiv,
eventsToStop[i],
OpenLayers.Event.stop);
OpenLayers.Event.observe(this.minimizeDiv,
eventsToStop[i],
OpenLayers.Event.stop);
}
*:取自文件:的OpenLayers/lib中/的OpenLayers /控制/ OverviewMap.js
插入並修改這個,可以用來創建我認爲你正在尋找的效果。
祝你好運!
感謝您的回答 – ricardo 2010-02-08 15:46:45
你能澄清一下這個問題嗎?你的意思是在OpenLayers視口內插入一個自定義表單? – amercader 2010-01-13 14:22:51