AW: [OpenLayers-Users] Re: Clicking on a polygon-opening a page/link

Arnd Wippermann arnd.wippermann at web.de
Sat Jun 4 19:54:27 EDT 2011


Hi,

Try something like this:

function onFeatureSelect(evt) {

    var objF = evt.feature;

    var theUrl = objF.attributes['name'] ? objF.attributes['name'] :
"about:blank";
    if(popo)
        PopupWindow(100, 100, 600, 400, theUrl, "_new");

}

//##########################################################################
#################
// popup window handling, close child windows
//##########################################################################
#################
function PopupWindow(Links, Oben, dieBreite, dieHoehe, dieUrl, targetValue)
{
    // neues Fenster öffnen

    var szWinStyle = new String ("");
    szWinStyle =  'toolbar=no, location=no, directories=no, status=yes,
menubar=no, scrollbars=yes, resizable=yes';
    szWinStyle += ', top=' + Oben + ', left=' + Links + ', width=' +
dieBreite + 'px, height=' + dieHoehe +'px';

    var newWin = window.open (dieUrl, targetValue, szWinStyle);
    newWin.focus();

    return(true);
}

http://gis.ibbeck.de/ginfo/apps/OLExamples/OL26/examples/select-feature-with
-function.html
 
Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Vikash
Talanki
Gesendet: Samstag, 4. Juni 2011 23:47
An: users at openlayers.org
Betreff: [OpenLayers-Users] Re: Clicking on a polygon-opening a page/link

Hi Nizzok,

 Thanks for the reply but as you said "You could then have the href embedded
in a popup"...... but i want to be redirected to a web page instead of
getting the popup

--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Clicking-on-a-polygon-opening-a-page-
link-tp6440300p6440336.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list