Adding Scroll Bars in TextFile Popup Windows via Layer.Text layer. (Closes #834)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@4225 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-09-12 01:58:27 +00:00
parent 259fe7ac81
commit 8f402c063f
5 changed files with 54 additions and 3 deletions

View File

@@ -185,6 +185,11 @@ OpenLayers.Feature = OpenLayers.Class({
this.data.popupContentHTML,
anchor,
closeBox);
if (this.data.overflow != null) {
this.popup.contentDiv.style.overflow = this.data.overflow;
}
this.popup.feature = this;
}
return this.popup;

View File

@@ -84,7 +84,7 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
var vals = currLine.split('\t');
var location = new OpenLayers.LonLat(0,0);
var title; var url;
var icon, iconSize, iconOffset;
var icon, iconSize, iconOffset, overflow;
var set = false;
for (var valIndex = 0; valIndex < vals.length; valIndex++) {
if (vals[valIndex]) {
@@ -116,7 +116,9 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
title = vals[valIndex];
} else if (columns[valIndex] == 'description') {
description = vals[valIndex];
}
} else if (columns[valIndex] == 'overflow') {
overflow = vals[valIndex];
}
}
}
if (set) {
@@ -139,6 +141,9 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
if ((title != null) && (description != null)) {
data['popupContentHTML'] = '<h2>'+title+'</h2><p>'+description+'</p>';
}
data['overflow'] = overflow || "auto";
var feature = new OpenLayers.Feature(this, location, data);
this.features.push(feature);
var marker = feature.createMarker();