1

Topic: Enabling pop-up query for Distribution Map 1

Hi,

I'm using Distribution Map 1 to show locations for the PlantTracker species.

I wanted to try enabling the pop-up feature to query points and there's a section in the report to do this (Click to query occurrences) but I can't get the feature to work.

My map lacks the ? icon which other sites where this works have.  I can't see any obvious way of getting this to appear on my maps using this map report type?  Perhaps there is a relevant control I can add to the map?

Thanks

Dave

2

Re: Enabling pop-up query for Distribution Map 1

Hi Dave,

The answer to your question is that the ? (selectFeature) control button is not added to the map because it is not needed. It would only be needed if there were other controls that you might choose between but that is not the case for the simple map.

There is no ambiguity: if you click on the map it tries to select a feature, drag and it will pan the map.

That said, it is not working for me either. Why? Because I get a "Cross-Origin Request Blocked" error. This is standard internet stuff that says a browser script from a server can only talk with its server of origin and can't go off chatting with strangers. The script has to ask its mama to go ask the stranger for sweeties or, in computer jargon, we need to proxy the request.

If you read the help text under the Click on Occurrences Mode drop down it says "For this to work, the Indicia Proxy module must be enabled in Drupal and the IForm Proxy Passthrough permission must be granted to the Drupal user roles that are able to access the map."

No one can have wanted to do this recently (or there is another way that I am not aware of) because that module has not been updated from Drupal 6 to Drupal 7.

Jim Bacon.

3

Re: Enabling pop-up query for Distribution Map 1

If anyone wanted to do some work on this to get it going I have a proposal. GeoServer, since v2.3, has provided a JSONP response option for GetFeatureInfo.

By enabling this response at the server and rewriting the request handling in jquery.IndiciaMapPanel, we would provide support for this capability across all platforms and remove the dependency on a proxy script.

I don't think that would be very much work at all. In fact I can't resist having a little look.

Jim Bacon

4

Re: Enabling pop-up query for Distribution Map 1

Thanks Jim,

Look forward to hearing how you get on!  Thank you

D

5

Re: Enabling pop-up query for Distribution Map 1

Hi Dave,

I have committed a fix that works for me.
https://github.com/Indicia-Team/media/c … 83f62ce172

In order for this to work requires GeoServer >= version 2.3 and for a configuration setting to be altered.
Warehouse1 is at version 2.6.0 but I am not going to fiddle with its configuration on a Friday afternoon.
Testwarehouse is at version 2.2.4 so I will check with colleagues and see about updating it.

Jim Bacon

6

Re: Enabling pop-up query for Distribution Map 1

I have made the configuration change on warehouse1 and updated testwarehouse to GeoServer 2.7.2 so you can try applying the patch above to see if this works

Jim Bacon

7

Re: Enabling pop-up query for Distribution Map 1

Hi Jim,
did you get a response to this job? I tried applying the patch above but it did not work for me. I can´t get any features from geoserver. There´s geoserver 2.6.2 installed on our server and jsonp activated. I can get features from within other OpenLayers applications but not in prebuild form distribution map.
Are there any dependencies on versions of OpenLayers? Or maybe Stylesheets?

8

Re: Enabling pop-up query for Distribution Map 1

Hi

Are you using the Distribution Map 1 prebuilt form in a Drupal 7 site using the IFrom module? If so, it comes with the required version of OpenLayers

Can you use your browser developer tools to investigate the network traffic when you click an item on your map? Ensure that a request is being sent to GeoServer and examine the response. This may give you some clues.

Jim Bacon.

9

Re: Enabling pop-up query for Distribution Map 1

Hi Jim,
I forgot to write, yes I am using Distribution Map 1 prebuilt form in Drupal 7. There are two error messages when calling the form:
1. OpenLayers.Protocol.Script is not a function
This appears right at the beginning.
2. Cannot set property 'callbackKey' of undefined
This appears when I click on a distribution point.
I cannot find any log entry in Geoserver beside from these for the map itself.
Jürgen

10

Re: Enabling pop-up query for Distribution Map 1

Hi

Okay, looks like you are getting JavaScript errors which probably mean the script is aborted before any request is ever sent to GeoServer.

Is the web page publicly accessible so we can have a look?

Jim Bacon.

11

Re: Enabling pop-up query for Distribution Map 1

Hi Jürgen

I realised something in the night. The IForm module comes with 3 different copies of OpenLayers and they are not all the same.

They are as follows, in order of size:
- OpenLayers-debug.js, a full version debug version,
- OpenLayers-min.js, a full minified version,
- OpenLayers.js, a subset of the library tailored for Indicia.

A quick search finds OpenLayers.Protocol.Script is not present in the OpenLayers.js file which is the default used by the IForm module. The script can be changed by enabling the Indicia OpenLayers module which adds an option to the Configuration > IForm > Settings to pick one of the others.

Jim Bacon

12 (edited by namwebs 01-03-2016 11:49:18)

Re: Enabling pop-up query for Distribution Map 1

Thanks for this info.

enabling the Indicia OpenLayers module

Should this appear on the normal modules page? It doesn't for me. Do I need to update something? (See attached.)

Post's attachments

module versions.docx 139.58 kb, 3 downloads since 2016-03-01 

You don't have the permssions to download the attachments of this post.

13

Re: Enabling pop-up query for Distribution Map 1

Hi

This module should not be required unless you have some very special circumstances.
If the iform/modules/iform_openlayers folder is not present in your installation it can be obtained from the Git repository of the iform module, https://github.com/Indicia-Team/drupal-7-module-iform

Jim Bacon.