Ticket #1135: Text_with_any_attribute.diff
| File Text_with_any_attribute.diff, 2.7 kB (added by jachym, 1 year ago) |
|---|
-
lib/OpenLayers/Layer/Text.js
old new 91 91 var vals = currLine.split('\t'); 92 92 var location = new OpenLayers.LonLat(0,0); 93 93 var title, url, description; 94 var otherAttributes = {}; 94 95 var icon, iconSize, iconOffset, overflow; 95 96 var set = false; 96 97 for (var valIndex = 0; valIndex < vals.length; valIndex++) { … … 125 126 description = vals[valIndex]; 126 127 } else if (columns[valIndex] == 'overflow') { 127 128 overflow = vals[valIndex]; 128 } 129 } else { 130 otherAttributes[columns[valIndex]] = vals[valIndex]; 131 } 129 132 } 130 133 } 131 134 if (set) { … … 150 153 } 151 154 152 155 data['overflow'] = overflow || "auto"; 156 157 // add all other attributes 158 for (var key in otherAttributes) { 159 data[key] = otherAttributes[key]; 160 } 153 161 154 162 var feature = new OpenLayers.Feature(this, location, data); 155 163 this.features.push(feature); -
tests/data_Layer_Text_textfile.txt
old new 1 point i mage2 10,20 http://boston.openguides.org/markers/ORANGE.png3 15,25 http://boston.openguides.org/markers/ORANGE.png1 point id image 2 10,20 1 http://boston.openguides.org/markers/ORANGE.png 3 15,25 a http://boston.openguides.org/markers/ORANGE.png -
examples/textfile.txt
old new 1 point title description icon2 1 0,20 my orange title my orange description3 2 ,4 my aqua title my aqua description4 42,-71 my purple title my purple description<br/>is great. http://www.openlayers.org/api/img/zoom-world-mini.png1 id point title description icon 2 1 10,20 my orange title my orange description 3 2 2,4 my aqua title my aqua description 4 a 42,-71 my purple title my purple description<br/>is great. http://www.openlayers.org/api/img/zoom-world-mini.png
