[OpenLayers-Users] Problem with WFS/Popups in Firefox

Marc Jansen jansen at terrestris.de
Mon Jan 4 10:28:31 EST 2010


Hi Barbara,

If I click on a feature located at POINT(2552356 5693550) (near 
Angerhausen, South of Duisburg) I get a GetFeatureInfo-Request with the 
BBOX 2546405, 5692856, 2547405, 5693856. And of course the popup is 
placed at the wrong coordinates and the GFI-Request is empty.

IMO you should try to search the error in the BBOX creation-function.

Regards,
Marc

PS: I'd guess that this problem should arise in IE as well... haven't 
tested though.



Rauch, Barbara wrote:
>
> Hello,
>
> I successfully implemented WFS-Layers with individual symbols by 
> creating an OpenLayers feature class for each layer. These symbols are 
> clickable via clickevent that opens a Popup which is filled with 
> informations by a GetFeatureRequest. In Internet Explorer everything 
> works fine but in Firefox I have the following problem with the popup: 
> After panning the map, some of the popups do no longer open on the 
> symbol but are displaced and open with an offset away from the symbol 
> – that does not occur always to the same WFS but changes. The problem 
> is, that the popups then also don’t get the informations and there is 
> no error-message in firefox (I’m working with version 3.0).
>
> You can see a live-demo here: 
> http://services.metropoleruhr.de/ol_print/ol_viewer.html
>
> Does anybody know how to fix this problem?
>
> Thanks for your help and greetings from Marleen
>
> Hi Marc,
>
> when you start the client in Firefox, you afterwards have to zoom in 
> twice, then the symbols of the overlays occur - when you then pan the 
> map (drag&drop while the left mouse is pressed) and afterwards click 
> on the symbols, some of the popups don't opne right at the symbol but 
> displaced in the map - not always the same symbols behave like this 
> and Firefox doesn't give an error-message -all that makes it very 
> difficult to find the error... I hope this description helps so far?
>
> Thanks and greetings
>
> Marleen
>
> Hello again,
>
> thanks a lot for your answer, Marc.
>
> In the case, when the popup doesn't display any content, there is a 
> 'NULL' in the database - this error will be solved in january by 
> myself via the database. But I don't know, how to solve the problem 
> with the displaced popups after one panned the map. You asked, how I 
> obtain the clicked ccordinate. Here my source-code:
>
> function addClickEvent( wfslayer, typename)
>
> {
>
> // WFS-Abfrage + Popup-Initialisierung
>
> //Definition der BoundingBox-Größe
>
> OpenLayers.Events.prototype.includeXY = true;
>
> wfslayer.events.register("click", map, function(e){
>
> // Mauspostition bestimmen
>
> // (konvertiert von Pixel in o.g. EPSG-Koordinaten)
>
> var lonlat = map.getLonLatFromPixel(e.xy);
>
> //alert(lonlat);
>
> // Toleranzwert 'delta' berechnet mit geometrischer
>
> // Folge: 1000*(0.5)^(zoomlevel)
>
> var delta = 1000 * Math.pow(0.5, map.getZoom() );
>
> var more = lonlat.add(delta, delta);
>
> var less = lonlat.add(-delta, -delta);
>
> var boundingbox = less.lon + "," + less.lat + "," + more.lon + "," + 
> more.lat;
>
> //alert(boundingbox);
>
> // WFS-Abfrage
>
> var url_rvr = wfslayer.getFullRequestString({
>
> REQUEST: "GetFeature",
>
> BBOX: boundingbox,
>
> INFO_FORMAT: 'text/plain',
>
> TYPENAME: typename
>
> });
>
> OpenLayers.loadURL(url_rvr, '', this, setHTML);
>
> // Popup-Initialisierung
>
> popup = new OpenLayers.Popup.AnchoredBubble("siteinfo", lonlat, new 
> OpenLayers.Size(180, 270));
>
> //popup.AutoSize = true;
>
> popup.setContentHTML("<div id='mapinfobox'><div 
> id='nodelist'></div></div>");
>
> popup.setOpacity(1.0);
>
> popup.setBackgroundColor("FFFFFF");
>
> popup.addCloseBox(destroy);
>
> map.addPopup(popup, true);
>
> $('nodelist').innerHTML = "Searching for data...";
>
> Event.stop(e);
>
> });
>
> }
>
> Do you really think, it could be a problem with the projection? I 
> would in this case expect, that the popup-displacement also occurs in 
> the InternetExplorer - or do the browsers handle projections in 
> different ways?
>
> Here my source-code concerning the projection in OpenLayers:
>
>  //*** edit EPSG options here! *** 
>             var options_31466 = {
>                 projection:"EPSG:31466",
>                                scales: [250000, 50000, 15000, 10000, 5000, 2500, 1000],
>                 maxExtent: new OpenLayers.Bounds(2520400, 5675000, 2638545, 5744500),
>                 maxResolution: 'auto',
>                 numZoomLevels: 7,
>                 controls: [],
>                 units: 'm'
>             };                 
>             map = new OpenLayers.Map('map', options_31466); 
>
> I thought, it's enough to include the projection in this way and that 
> OpenLayers then automatically does the rest?
>
> Do I have to include proj4 as you wrote:
>
> * Are you sure that your projection is set correctly? Did you
> include a pro4.js-definition for 31466?
>
> Proj4js.defs["EPSG:31466"] = "+proj=tmerc +lat_0=0 +lon_0=6 +k=1
> +x_0=2500000 +y_0=0 +ellps=bessel +datum=potsdam +units=m +no_defs";
>
> Where do I have to put the Proj4.defs?
>
> Thanks a lot merry christmas and greetings
>
> Marleen
>
> Mit freundlichen Grüßen
> Im Auftrag
>
> **Barbara Rauch***
> *
>
> Klima u. Lufthygiene
> Kronprinzenstraße 35
> 45128 Essen
> Fon: +49 201 2069-399
> Fax: +49 201 2069-400
> rauch at rvr-online.de
>
>
>
> Regionalverband Ruhr
> Kronprinzenstraße 35
> 45128 Essen
> Zentrale: +49 (0) 201 2069-0
> Fax: +49 (0) 201 2069-500
> www.rvr-online.de
>
> Postfach 10 32 64
> 45032 Essen
>
> Steuernummer: RVR 112/5775/0426
> USt.-ldNr.: DE 173867500
>
> Diese E-Mail koennte vertrauliche und/oder rechtlich geschuetzte 
> Informationen enthalten.
> Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
> irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender 
> und vernichten Sie diese Mail.
> Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail 
> sind nicht gestattet.
> This e-mail may contain confidential and/or privileged information.
> If you are not the intended recipient (or have received this e-mail in 
> error) please notify the sender immediately and destroy this e-mail.
> Any unauthorised copying, disclosure or distribution of the material 
> in this e-mail is strictly forbidden.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   


-- 


  Dipl.-Geogr. Marc Jansen
  - Anwendungsentwickler -

  terrestris GmbH & Co. KG
  Irmintrudisstraße 17
  53111 Bonn

  Tel:    ++49 (0)228 / 96 28 99 -53
  Fax:    ++49 (0)228 / 96 28 99 -57

  Email:  jansen at terrestris.de
  Web:    http://www.terrestris.de

  Amtsgericht Bonn, HRA 6835
  Komplementärin:  terrestris Verwaltungsgesellschaft mbH
  vertreten durch: Hinrich Paulsen, Till Adams  





More information about the Users mailing list