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've used jquery-ui draggable option as following but the moving popup can not be ended once dragging has started. Is there any another method to make OpenLayers.Popup draggable?

popup = new OpenLayers.Popup.AnchoredBubble(
                "JInfo",                                            // id
                 jFeature.geometry.getBounds().getCenterLonLat(),  // lonlat
                 new OpenLayers.Size(ISA.Size.POPUP_WIDTH, ISA.Size.POPUP_HEIGHT),
                 html,                                           // contentHTML
                 null,                                           // anchor
                 true,                                           // closeBox
                 function(){                                    // closeBoxCallback
                          jSelectControl.unselect(jFeature);
                 });        
jFeature.popup = popup;    
map.addPopup(popup);    
$("#JInfo").draggable();

Thanks advance for your helps,

Yasemin

share|improve this question
add comment

1 Answer 1

An OL extension has been coded for that.

You will find a blog post relative to the draggable behavior and the extension implementation : http://aamirafridi.com/openlayers/openlayers-draggable-popups

With a link to the demo : http://jsbin.com/agopa3

The extension full code is available on the blog page. Hope it helps.

share|improve this answer
add comment

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.