[Geomoose-users] getProjection error - select.php
James Klassen
klassen.js at gmail.com
Tue Jun 11 11:38:10 PDT 2013
Ideally, the PHP would check for groups and explode them into layers then
act on the layers.
That would probably be implemented by checking both the name and group of
each layer and including the layer if either match as it iterates through.
Something like this (not tested):
===============================
diff --git a/htdocs/php/select.php b/htdocs/php/select.php
--- a/htdocs/php/select.php
+++ b/htdocs/php/select.php
@@ -193,7 +193,14 @@ if($layer == 'all') {
array_push($layersToQuery, $map->getLayer($i));
}
} else {
- array_push($layersToQuery, $map->getLayerByName($layer));
+ $group_layers = $map->getLayersIndexByGroup($layer);
+ if(count($group_layers) > 0) {
+ foreach($group_layers as $layerid) {
+ array_push($layersToQuery, $map->getLayer($layerid);
+ }
+ } else {
+ array_push($layersToQuery, $map->getLayerByName($layer));
+ }
}
$foundShapes = array();
================================
Also, might have to be more careful about not including the same layer
twice.
Jim
On Jun 11, 2013 12:40 PM, "TC Haddad" <tchaddad at gmail.com> wrote:
> On Tue, Jun 11, 2013 at 10:30 AM, Jim Klassen <klassen.js at gmail.com>
> wrote:
>
> I'm not sure Firebug would tell you. GeoMoose JS only knows what is in
>> the mapbook. If you give it a group it will send a group. The question is
>> if the GeoMoose PHP side is handling groups correctly within MapScript.
>>
>>
> Exactly.
>
> Yesterday Eli and I discussed this a bit more on IRC, and I looked at the
> php around line 215 a bit more closely. The failure is happening when the
> code checks the projection of the LAYER. But if the LAYER does not have a
> projection it will use the projection of the MAP.
>
> In my situation, all my Layers have projections and they are all the same,
> and are the same as the MAP projection, so in theory I can comment out the
> 3 lines of php that check the LAYER projection, which will force it to use
> the projection of the MAP. This *should* mean that I can GROUP my layers
> and still be able to use the select tool without further workarounds or
> trickery.
>
> Have not yet had a chance to test and confirm yet....
>
> T
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20130611/5a2217ae/attachment.html>
More information about the Geomoose-users
mailing list