[maplab-users] how to stop maplab querying raster layers[Scanned for Viruses and Spam]

joanne cook j.cook at oxfordarch.co.uk
Wed Nov 24 06:47:25 EST 2004


Hi Zak,
 
Many thanks, your suggested edit of the query.phtml code worked a treat! I may try some of your other suggestions at some point, but this will do just fine for now.
 
Jo
 
-------------------------------------------
Joanne Cook
Oxford Archaeology North
-------------------------------------------

________________________________

From: Zak James [mailto:zak-ms at hoppsan.org]
Sent: Tue 23/11/2004 18:43
To: joanne cook
Cc: maplab-users at maptools.org
Subject: Re: [maplab-users] how to stop maplab querying raster layers[Scanned for Viruses and Spam]



Joanne,

I checked the mapbrowser code and it will only add a layer to the
queryable set if the layer has status set to ON or DEFAULT. Mapserver
will only generate query results for layers with the TEMPLATE set, but
it is possible those layers are causing a slowdown just because they
are being added to the list - I'm not sure why.

If you are prepared to modify the source code, you could edit the
maplab/htdocs/mapbrowser/query.phtml file so that it ignored raster
layers.

Around line 140, you would need to add a clause to the code that checks
the status:
     for ( $i=0; $i<$nCount; $i++ )
     {
         // get layer name
         $oLayer = $oMap->getLayer( $i );

         // only add if on
         if (( $oLayer->status == MS_ON || $oLayer->status ==
MS_DEFAULT) &&
               $oLayer->type != MS_LAYER_RASTER)         //<-----ignore
rasters
         {
             array_push( $aszLayers, $oLayer->name );
         }
     }

If you would like more control over which layers are ignored, you might
try doing something with the layer metadata or connectiontype. Details
on the available elements can be found here:

http://mapserver.gis.umn.edu/doc/phpmapscript-class-guide.html

zak
--
Zak James
Applications and Software Development
DM Solutions Group Inc.
http://www.dmsolutions.ca








More information about the Maplab-users mailing list