[GIS] How to Edit Popup using Openlayers Text Layer

javascriptopenlayers-2popup

I am creating a map with about 1000+ points using Openlayers. Currently when I click on one point's icon, the description for the point shows up in a popup, and to exit the popup I need to click on the same point's icon again. Is there a way to modify the code for this so that I can press a close button or I can click anywhere on the map so that this popup will close again? I know there is a way if I am just using a regular popup but I am using an Openlayers.layer.text layer.

var pois = new OpenLayers.Layer.Text( "Frequencies",
            { location:"./frequencyrange.txt",
              projection: map.displayProjection
            });
    map.addLayer(pois);

I use this code to add the text layer. Within the text file would be the following columns: lon lat title description icon iconSize iconOffset. Is there another column that I should add for the popup? I have tried a column that was supposed to modify the size of the popup but it did not work for me. So, so far I have not been able to modify the popup except for what is in it.

Best Answer

This OpenLayers example shows a type of pop up that has a close button and is using the same type of layer so I shouldn't be difficult to you to adapt it to your case.