Opened 12 years ago
Closed 12 years ago
#172 closed defect (fixed)
identify service handling nonvisible layers
Reported by: | bfischer | Owned by: | jimk |
---|---|---|---|
Priority: | major | Milestone: | 2.6.1 |
Component: | GeoMOOSE/PHP | Version: | 2.6 |
Keywords: | Cc: |
Description ¶
The identify service currently does not allow for passing both visible and non-visible layers in the identify service. the solution to this is to modify the JS code to pass in all layers and then for the identify.php to process them only once.
Jim K. is going to prepare a patch for the JS code. HEI will prepare a patch for the idenfity.php code.
Change History (6)
by , 12 years ago
Attachment: | tab_service.js.patch added |
---|
comment:1 by , 12 years ago
The GeoMoose JS patch allows GeoMoose to pass multiple parameters with the same name (much like a HTML form checkbox group) to a service in GET and POST modes. This supports multiple
<service ... > ... <input name="layers" type="hidden" value="..." /> <input name="layers" type="visiblelayers"/> </service>
case needed for this ticket and potentially other cases in the future. The patch works by changing the params variable in callService() of GeoMOOSE.Tab.Service to be a hash of keys and arrays of values rather than a hash of keys and values. dojo.xhrPost understood this natively. I modified the open new window code to work accordingly.
One potential problem area is code that may use this.lastServiceParams will need to support the new format. I could not find any existing GeoMOOSE code that referenced the lastServiceParams parameter and it is not part of a public API, so I don't think this will cause any problems.
comment:3 by , 12 years ago
We think adding:
$layersList = array_unique($layersList);
after:
line 46, $layersList = explode(':', $visibleLayers);
will do the trick. I don't have a good thing setup to test right now. Can you apply this change and then leave as testing. Then I will get a scenario setup to test and if working will close ticket.
comment:4 by , 12 years ago
Status: | new → testing |
---|
Found some PHP quirks. Mainly, PHP does not handle multiple same name URL parameters. That makes passing in something like layers=a,b,c&layers=d,e,f
impossible. At least not without doing a collection of inconvenient parsing work.
To resolve this we've added support for another input named hidden_layers
.
The new code block works like this:
<service name="identify" title="Identify" display="true"> <url>php/identify.php</url> <step type="spatial" name="shape" line="false" polygon="false" jump-start="true" default="point" box="true" pan="false"> <header> Click on the map to see more detailed information. </header> <input type="hidden" name="hidden_layers" value="parcels/parcels"/> <input type="visiblelayers" name="layers"/> <input type="projection" name="projection"/> </step> </service>
Voila! It works. r943
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | testing → closed |
Seems to work. Closing ticket.
Patch against r936