update text layer to new paradigm

git-svn-id: http://svn.openlayers.org/trunk/openlayers@452 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-29 13:59:06 +00:00
parent fda77ec943
commit 71df3e08fa

View File

@@ -73,10 +73,23 @@ OpenLayers.Layer.Text.prototype =
} }
} }
if (set) { if (set) {
var data = {}; var data = new Object();
data['iconURL'] = url;
data['iconSize'] = iconSize; if (url != null) {
data['iconOffset'] = iconOffset; data.icon = new OpenLayers.Icon(url,
iconSize,
iconOffset);
} else {
data.icon = OpenLayers.Marker.defaultIcon();
//allows for the case where the image url is not
// specified but the size is. use a default icon
// but change the size
if (iconSize != null) {
data.icon.setSize(iconSize);
}
}
data['popupContentHTML'] = '<h2>'+title+'</h2><p>'+description+'</p>'; data['popupContentHTML'] = '<h2>'+title+'</h2><p>'+description+'</p>';
var feature = new OpenLayers.Feature(this, location, data); var feature = new OpenLayers.Feature(this, location, data);
var marker = feature.createMarker(); var marker = feature.createMarker();