[OpenLayers-Users] Popup Error: Select is not defined

boesiii boesiii at yahoo.com
Tue Apr 9 12:21:14 PDT 2013


I am having a problem with my select control.  I am not able to close the
popup box by clicking the red "x".  When I try and click the red "x" I get
an error in the javascript console stating, "Uncaught ReferenceError: select
is not defined, Line 533".

Line 533:
function onPopupClose(event) {
		select.unselectAll();
	}

Other relevant code snippets:

mh_layer.events.on({
			"featureselected": onFeatureSelect,
			"featureunselected": onFeatureUnselect
		});

var control_select = new OpenLayers.Control.SelectFeature(
			[mh_layer, sp_layer], {
				displayClass: 'olControlSelect'
			}
		);

function onFeatureSelect(event) {
            var feature = event.feature;
            // Since KML is user-generated, do naive protection against
            // Javascript.
            var content = "Manhole ID:" + feature.attributes.STRUCT_ID;
            if (content.search("<script") != -1) {
                content = "Content contained Javascript! Escaped
content below.<br>" + content.replace(/</g, "<");
            }
            popup = new OpenLayers.Popup.FramedCloud("chicken", 
                                    
feature.geometry.getBounds().getCenterLonLat(),
                                     new OpenLayers.Size(100,100),
                                     content,
                                     null, true, onPopupClose);
            feature.popup = popup;
            map.addPopup(popup);
        }








--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Popup-Error-Select-is-not-defined-tp5045606.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list