Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using the GeoExt example and this is the js code and trying to get rid of the multiple lat and lon that get added into the PopUp on multiple clicks.

Not sure which is the code that I need to comment out? I thought that removing,

this.handlerOptions = OpenLayers.Util.extend(
            options && options.handlerOptions || {}, 
            this.defaultHandlerOptions
        ); 

Would do the job but it seems that is not right as I am still getting the multiple popups and commenting out that code made no difference. Not sure what that code was for?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Try to modify code of your Click control:

var control = new OpenLayers.Control.Click({
    trigger: function(evt) {
        var loc = mapPanel.map.getLonLatFromViewPortPx(evt.xy);
        if (popup) popup.close();
        addToPopup(loc);
    }
});
share|improve this answer
    
thanks a lot that works beautifully. Another problem is that in the example that i have posted in the question, the popup moves along with the location, in my case it continues to be static. I think it because of the difference in the projection, but do not know how should I change the projection? –  Sam007 Aug 1 '12 at 22:13
    
I did add location: loc.xy to the popup = new GeoExt.Popup({}) but still it made no difference. –  Sam007 Aug 1 '12 at 22:16
    
Could you create new question and share your code or live demo link? –  drnextgis Aug 1 '12 at 22:47
    
here is the question and the link to my app gis.stackexchange.com/questions/30767/… –  Sam007 Aug 2 '12 at 2:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.