1
我想更新地圖中的一些彈出窗口,但我無法做到這一點。首先我創建一些標記,然後用下一個代碼創建一個與它們相關聯的彈出窗口。每個標記一個彈出框:更新OpenLayers popup
popFeature = new OpenLayers.Feature(markers, location);
popFeature.closeBox = true;
popFeature.popupClass = OpenLayers.Class(OpenLayers.Popup.FramedCloud, {
'autoSize': true
});
popFeature.data.popupContentHTML = "hello";
popFeature.data.overflow = (false) ? "auto" : "hidden";
var markerClick = function (evt) {
if (this.popup == null) {
this.popup = this.createPopup(this.closeBox);
map.addPopup(this.popup);
this.popup.show();
} else {
this.popup.toggle();
}
currentPopup = this.popup;
OpenLayers.Event.stop(evt);
};
mark.events.register("mousedown", popFeature, markerClick);
之後,我將新標記添加到我的標記圖層。
一切都很好,直到這裏,但我希望一段時間後更新popupcontentHTML,我不知道我怎麼能訪問到該值。
我讀了OL API,但我不明白如何得到它。我迷失於功能,事件,擴展...
我想知道我是否可以訪問該屬性並編寫其他詞。