Openlayers popup not closing

المشرف العام

Administrator
طاقم الإدارة
This is a special case, I have many popups attached to objects and they work fine and I am having a problem in only one case.

All layers and popups are handled by select control's onFeatureSelect, but this one is handled by layers featureSelected event.

On opening popup it throws:

Uncaught TypeError: Cannot read property 'lat' of null.

Expanding error shows error on function OpenLayers.Bounds.OpenLayers.Class.determineQuadrant but the popup opens.

On Clicking the close button, the click event is also fired and onPopupClose function is also called ( I have checked it with monitor and monitorEvents in console) but the popup does not close. The popup in other layers is still function normally.

Here is the code:

select_Control = new OpenLayers.Control.SelectFeature([business, schools, healthfacilities, open_space], { onSelect: onFeatureSelect, onUnselect: onFeatureUnselect, click: true});open_space.events.on({ "featureselected": function(e) { var PopupPos1 = e.feature.geometry.getBounds().getCenterLonLat(); popup_content = 'sifal ground


'; var popup1 = new OpenLayers.Popup.FramedCloud("chicken", PopupPos1, null, popup_content, null, true, onPopupClose); e.feature.popup = popup1; map.addPopup(popup1); popup1.setBackgroundColor('#FFBBBB'); popup1.updateSize(); popup1.draw(); }})function onPopupClose(e) { select_Control.unselectAll();}function onFeatureSelect(feature) { //debugger; var PopupPos1 = new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y) popup_content = feature.attributes.name; var popup1 = new OpenLayers.Popup.FramedCloud("chicken", PopupPos1, null, popup_content, null, true, onPopupClose); feature.popup = popup1; map.addPopup(popup1); popup1.setBackgroundColor('#FFBBBB'); popup1.draw();}function onFeatureUnselect(feature) { map.removePopup(feature.popup); select_Control.unselectAll();}

أكثر...
 
أعلى