Fixed a regression introduced by r9271. Now Format.Text works as

described in #1844. r=tschaub (closes #2043)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9286 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-04-14 07:22:55 +00:00
parent 4b9393c809
commit 1c319bc4a7
2 changed files with 6 additions and 11 deletions

View File

@@ -50,12 +50,12 @@ OpenLayers.Format.Text = OpenLayers.Class(OpenLayers.Format, {
initialize: function(options) {
options = options || {};
if(options.extractStyles == true) {
if(options.extractStyles !== false) {
options.defaultStyle = {
'externalGraphic': OpenLayers.Util.getImagesLocation() +
"marker.png",
'graphicXSize': 21,
'graphicYSize': 25,
'graphicWidth': 21,
'graphicHeight': 25,
'graphicXOffset': -10.5,
'graphicYOffset': -12.5
};
@@ -96,7 +96,6 @@ OpenLayers.Format.Text = OpenLayers.Class(OpenLayers.Format, {
null;
var icon, iconSize, iconOffset, overflow;
var set = false;
var styleSet = false;
for (var valIndex = 0; valIndex < vals.length; valIndex++) {
if (vals[valIndex]) {
if (columns[valIndex] == 'point') {
@@ -115,17 +114,14 @@ OpenLayers.Format.Text = OpenLayers.Class(OpenLayers.Format, {
else if (columns[valIndex] == 'image' ||
columns[valIndex] == 'icon' && style) {
style['externalGraphic'] = vals[valIndex];
styleSet = true;
} else if (columns[valIndex] == 'iconSize' && style) {
var size = vals[valIndex].split(',');
style['graphicWidth'] = parseFloat(size[0]);
style['graphicHeight'] = parseFloat(size[1]);
styleSet = true;
} else if (columns[valIndex] == 'iconOffset' && style) {
var offset = vals[valIndex].split(',');
style['graphicXOffset'] = parseFloat(offset[0]);
style['graphicYOffset'] = parseFloat(offset[1]);
styleSet = true;
} else if (columns[valIndex] == 'description') {
attributes['description'] = vals[valIndex];
} else if (columns[valIndex] == 'overflow') {
@@ -142,7 +138,6 @@ OpenLayers.Format.Text = OpenLayers.Class(OpenLayers.Format, {
geometry.transform(this.externalProjection,
this.internalProjection);
}
style = styleSet ? style : null;
var feature = new OpenLayers.Feature.Vector(geometry, attributes, style);
features.push(feature);
}