diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js index b2d914238b..49549ac49d 100644 --- a/lib/OpenLayers/Layer/Text.js +++ b/lib/OpenLayers/Layer/Text.js @@ -36,7 +36,7 @@ OpenLayers.Layer.Text.prototype = } else { var vals = currLine.split('\t'); var location = new OpenLayers.LonLat(0,0); - var name = ""; var description = ""; + var title = ""; var description = ""; var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',new OpenLayers.Size(10,17)); var set = false; for (var valIndex = 0; valIndex < vals.length; valIndex++) { @@ -52,22 +52,29 @@ OpenLayers.Layer.Text.prototype = } else if (columns[valIndex] == 'lon') { location.lon = parseFloat(vals[valIndex]); set = true; - } else if (columns[valIndex] == 'locationName') - name = vals[valIndex]; + } else if (columns[valIndex] == 'title') + title = vals[valIndex]; else if (columns[valIndex] == 'image') icon.url = vals[valIndex]; else if (columns[valIndex] == 'title') - location.title = vals[valIndex]; - else if (columns[valIndex] == 'description') - location.description = vals[valIndex]; + title = vals[valIndex]; + else if (columns[valIndex] == 'description') { + description = vals[valIndex]; + } } } if (set) { - this.addMarker(new OpenLayers.Marker(location,icon)); + var marker = new OpenLayers.Marker(location, icon); + var popup = new OpenLayers.Popup(null, location, null, '
'+description+'
'); + marker.events.register('click', this, function(evt) { this.map.addPopup(popup); Event.stop(evt); } ); //this.map.addPopup(popup); }); + this.addMarker(marker); } } } } + }, + testFunction: function() { + alert('tesT'); } });