AW: Antw: [Mapbender-users] MB 2.5.1: popup window-Realations
Manns, Marc
manns at str.de
Tue May 5 05:55:16 EDT 2009
Hi,
i don't think that this will work too,
because this code was written in time as
the featureinfos have been real popups.
I've tried to realize the code.
This is what i can say so far.
1.The new popup's are not only div tags rather iframes.
2.the iframes contents divs that are generated by featureinfo.
3. i think you you have to acces the parent.iframe
out of the div tag to close it, but i'm not that javascript expert.
I think that one of this functions could help (watch from line 108)
http://trac.osgeo.org/mapbender/browser/branches/2.5/http/javascripts/popup.js
but i couldn'access them out of my featureinfo yet.
i can also advise this firefox plugin, if you want to analyze
those problems.
https://addons.mozilla.org/de/firefox/addon/249
With this addon(sadly only available on windows firefox)
you are be able to browse the HTML source after javascript execution.
see on this screenhot:
http://users.skynet.be/mgueury/mozilla/screenshot.html
if you use that after you've opened a popup
you can see the iframes in index.php which are generated by javascript.
maybe a javascript expert could have a hint to access the close function of the popup.js....?
regards Marc
DE:
Hallo,
das trifft nicht ganz den Context.
Hier (echo "";) wird serverseitig (php) ein "nichts" zum div geschickt, so dass es garnicht erst öffnet.
1. wms-feature.info:
In unseren Fall haben wir einen Treffer. Die getroffene Objekt-ID wird im Template (wms-Feature-Info) eingesetzt. Im Template können aber keine weiteren Datenbank-Abfragen gemacht werden, weil php dort nicht interpretiert wird.
Daher wird an eine erweiterte Auskunft (php) weiter geleitet.
Gesucht wird nun der Javascript-Befehl, der das div-Element wieder schließt, nachdem das neue Fenster (Weiterleitung) geöffnet wurde. Das muss im Client geschehen, nicht schon im Server.
2. ALK-Print
Das Script enthält viele Beziehungen zu Elementen der GUI.
Alle laufen über "window."
Z.B.:
var ind = window.opener.parent.getMapObjIndexByName("mapframe1");
Das funktioniert nicht mehr, wenn es gar kein Window ist.
EN:
We have no empty "pupup".
The wms featureinfo serves an object-id which is redirected to a php-application.
We need a javascript-command to close the div after the redirection.
In case of ALK-Print it is more complex.
>From the script there are references to the mapframe of the gui, which opened the window/div.
var ind = window.opener.parent.getMapObjIndexByName("mapframe1");
This doesn't work in a div.
> -----Original Message-----
> From: mapbender_users-bounces at lists.osgeo.org
> [mailto:mapbender_users-bounces at lists.osgeo.org] On Behalf Of
> Ronald Woita
> Sent: Tuesday, May 05, 2009 7:24 AM
> To: mapbender_users at lists.osgeo.org
> Subject: Antw: [Mapbender-users] MB 2.5.1: popup window-Realations
>
> this is the code snippet from mb2.6-dev (ext_featureInfoTunnel.php) :
> Using this module empty popups generated by a
> featureInfoRequest won't be open.
>
> ...
> else{
> $x = new connector($nmr);
> if (empty($x->file)) {
> //close window if featureInfo has no result
> //echo "<body onLoad=\"javascript:window.close()\">";
> echo "";
> }
> else {
> echo $x->file;
> }
> }
> ....
>
> Ronald
>
>
>
> >>> F.Jaeger at KRZ.DE 04.05.2009 11:16 >>>
> DE:
>
> Hallo,
> mit Mapbender 2.5.1 wurde das Modul popup zwingend notwendig,
> damit LoadWMC noch funktioniert.
>
> Was sich vorher in einem neuen "window" öffnete, ist jetzt ein "div".
> Überall, wo in Scripten Objektbeziehungen verwendet werden,
> gibt es jetzt ein Problem.
>
> Z.B.
> WMS-Template: "window.close".
> ALK-Print: "window.opener.parent."
>
>
> Durch was muss "window" (oder "window.opener.parent.")
> ersetzt werden, damit es auch in einem "div" funktioniert?
>
>
> EN:
>
> After update from mapbender 2.5 to 2.5.1 it was nessasary to
> use "popup" in every GUI to keep "LoadWMC" working.
> Now WMS-Feature-Requests (templates from mapserver) and other
> modules opens as "div", not as "window".
>
> We have trouble with scripts that uses "window."-Relations
> ("window.close", "window.opener.parent.").
>
> What must be changed in this scripts to work in div?
>
_______________________________________________
Mapbender_users mailing list
Mapbender_users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapbender_users
More information about the Mapbender_users
mailing list