1

Re: Map OpenLayers PopUp

Did somebody try to build a Popup-function which can be used in iform integrated OpenLayers?

I tried to write a typical OpenLayers code in the jquery.indiciaMapPanel.js where I already put other functions like an overview-map and a navigation toolbar, but it didn't work.

When i am clicking in the distribution map, it always shows a syntax error in firebug. Seems like its still trying to create a point, but is disabled because its not in the edit-modus.

gaby

2

Re: Map OpenLayers PopUp

Hi Gaby
Do you have an online link to a page demonstrating this problem? If so I could take a look.

Also, if you are adding functionality to IndiciaMapPanel.js, then it would be great if you could send us a patch or the updated file so we can see which parts would be useful in the core code, otherwise it may be difficult for you when we release the next upgrade (since the upgrade could overwrite any existing file).

Best wishes

John van Breda
Biodiverse IT

3

Re: Map OpenLayers PopUp

Hey John,

here are some openlayers-functions working and i had to change some stuff in the css-file:

div.map.addControl(new OpenLayers.Control.PanZoomBar());
    div.map.addControl(new OpenLayers.Control.NavToolbar());
     div.map.addControl(new OpenLayers.Control.OverviewMap());

and I tried this for the popup:

var info = new OpenLayers.Control.WMSGetFeatureInfo({
            url: 'http://178.63.3.151:8080/geoserver/wms?', 
            title: 'Identify features by clicking',
            queryVisible: true,
            eventListeners: {
                getfeatureinfo: function(event) {
                    map.addPopup(new OpenLayers.Popup.FramedCloud(
                        "chicken", 
                        map.getLonLatFromPixel(event.xy),
                        null,
                        event.text,
                        null,
                        true
                    ));
                }
            }
        });
        div.map.addControl(info);
        info.activate();

We are trying now to use WFS, maybe thats a reason.

Regards,
gaby

4

Re: Map OpenLayers PopUp

Thanks Gaby. Have you tried removing the existing code in _bindControls which adds the click handler OpenLayers.Control.Click? I wonder if this handler is preventing your WMSGetFeatureInfo handler from being accessed. In FireBug, I notice that no WMS request is being made when you click on the page so it is not even getting that far.

John van Breda
Biodiverse IT

5

Re: Map OpenLayers PopUp

Thank you, John. But it did not work. There are no popups and if I remove the code _bindControl, I can't set any points in the MNHNL Dynamic Map anymore.

Gaby

6

Re: Map OpenLayers PopUp

Thanks for trying - removing the code was an experiment to test if it was clashing with your own code. I will have a go at putting ths WMSGetFeatureInfo handler into one of my own pages and let you know how I get on.

John van Breda
Biodiverse IT

7

Re: Map OpenLayers PopUp

Hi Gaby
In your helper config, does your geoserver_url setting include the http: at the beginning? Mine did not, and this caused OpenLayers to not think the layer was from the same URL so it would not query it. I have updated the IForm diagnostics check so that it reports this problem.

Also do you have a proxy set up in OpenLayers? If not then you will get problems with cross-domain access.

John van Breda
Biodiverse IT

8 (edited by gaby 03-11-2010 12:17:27)

Re: Map OpenLayers PopUp

Hello John,

thank you. The http: was already included. But I will check the proxy settings.

But what exactly do you mean with the proxy set up in OpenLayers? The Iform proxy?

Gaby

9

Re: Map OpenLayers PopUp

Hi Gaby,
No, I mean an OpenLayers proxy which I think it will try to use by default to avoid cross domain browser issues, at least it did when I tried debugging your scenario though I was using OpenLayers 2.1. Can you try using FireBug (a FireFox addon) to check whether a request is sent when you click on the map, and whether it is going to a proxy script or direct to the GeoServer? Also you can try putting a breakpoint on the map.addpopup line of code to see if it actually gets there and what the response is.

John van Breda
Biodiverse IT

10

Re: Map OpenLayers PopUp

Hi John,
we added our Proxy to the default map options, now the request is sent to the proxy and we get something back, even a few popups appeared. But - somehow this only works as long as the URL isn't anything else but the root URL (distribution map on the front page):

http://.../portalbb/                            -> works ok

http://.../portalbb/?&taxon=3211              -> no popups, no request sent
http://.../portalbb/?q=comment/reply/35#comment-form             -> no popups

Many thanks again for your efforts !

11

Re: Map OpenLayers PopUp

HI Gaby
Sorry for the delay. I have just committed a new version of the code to the SVN code repository (r2130) which includes the ability to do clicking on the map to get either a popup, or the data output into a div. I have gone a bit further to allow you to configure this on distribution_map_1 (see the new block of settings called "Click to Query Occurrences") as well as to choose the actual columns in the output.
Are you able to get the latest version from SVN to try it out? If you do, make sure you enable the iform proxy module in Drupal which does all the proxying work for you.

Best Wishes

John van Breda
Biodiverse IT

12

Re: Map OpenLayers PopUp

Hi John,

back again working on my website. First, I want to thank for your support.

I integrated the changes of the SVN r2130 and activated the proxy, but it doesn't work. And there's no error message in firebug.
Maybe you did some other important changes or fixes in the last months in the four files?
(At least I want to upgrade to 0.5, but after a short presentation of the website next week. So I tried to integrate the popup in the old code.)

If I'm upgrading the Iform to 0.5, is it important to upgrade Indicia to 0.5 as well?

Regards,
Gaby

13

Re: Map OpenLayers PopUp

Hi Gaby
I think in this case if you upgrade to 0.5 then you should also upgrade the Indicia Warehouse because there were some refinements to the submission structure in that version. Normally it does not matter.
Are you able to put an example page showing your problems online somewhere? Then I might be able to debug it from here.
Best Wishes

John van Breda
Biodiverse IT

14

Re: Map OpenLayers PopUp

Hi John,

I will update this week. If it's not working or you are interested in our work and topic, here is the site:

www.flora.web-mapping.com
It is still a test-site, so you can make any fictive data entries.

(We presented your indicia and the website on the FOSSGIS in Heidelberg, Germany, making it public to the open source community in germany.)

Regards,
Gaby