[OpenLayers-Users] New Popup windows

Joel Leininger leiningr at gmail.com
Fri Jun 17 19:13:28 EDT 2011


I'm trying to create popups that are new windows, not part of the main
map window. This seems like it should be fairly straightforward to do,
but I'm only a novice javascript programmer, and I can't make heads nor
tails out of the docs for OpenLayers.Popup.

I have Popup.FramedCloud working, and everything is correct with respect
to its contents. I only need to have popup generate a new, stand-alone
window. Can someone point me in the right direction?

Here is my FramedCloud (working) code:

var popup = null;
info = new OpenLayers.Control.WMSGetFeatureInfo({
            url:
'http://www.martenet.com/cgi-bin/mapserv?map=/home/public/sjm_ops/GeoData/BA-Grids.map',
            title: 'Identify features by clicking',
            queryVisible: true,
            eventListeners: {
                getfeatureinfo: function(event) {
                 if (!event.text.match(/<body>\s*<\/body>/)) {if (popup)
{popup.destroy(); popup = null;}
                   popup = new OpenLayers.Popup.FramedCloud(
                                   "popup",
                                   map.getLonLatFromPixel(event.xy),
                                   null,
                                   event.text,
                                   null,
                                   true
                                   );
                   map.addPopup(popup);
                                                }
                            }
                                                }
        });
        map.addControl(info);
        info.activate();


Thanks in advance for any help.

-J.



More information about the Users mailing list