[Mapserver-users] mapscript: removing layer from MapObj

Christoph Spoerri spoerri at duke.edu
Tue Oct 28 10:10:01 EST 2003


I guess I could do that, but then the user may remove and add many layers, 
resulting in quite a large mapfile (memory use?).

I know there are alternative to removing a layer, yet there are only 
alternatives. I hope I'm not to picky here. Also, I was wondering why there 
isn't a removeLayer() function/method. Actually, if I recall correctly, there 
isn't a removeClass()/removeSymbol() method either. Would there be some use 
for such functions/methods?

Christoph

On Tuesday 28 October 2003 09:39 am, David Fawcett wrote:
> Could you achieve the same effect by setting LAYER STATUS to OFF?
>
> David.
>
> David J. Fawcett
> MN Office of Environmental Assistance
>
> >>> Christoph Spoerri <spoerri at duke.edu> 10/28/2003 8:20:39 AM >>>
>
> Hi,
>
> I searched the mailing list and the web but didn't find a good way to
> remove
> an existing layer from a MapObj (I'm using PHP mapscripts).
>
> What I'm trying to accomplish: I have a map with multiple layers on it.
> I
> would like to store this object in a session, so that it can be
> retrieved
> again the next time a user sends a request (e.g. zooming in). One of
> those
> requests is to remove one or more layers from the map, yet in order to
> do
> this I would like to have a function/method similar to
> MapObj::removeLayer(LayerIndex). Anyway to accomplish this in such a
> fashion?
>
> I know, I could work with a basic mapfile and then just add the
> necessary
> layers, but this is rather 'backwards' in my opinion and requires me to
> keep
> track of existing layers and a bunch of other variables (I actually
> wrote a
> few classes that to that).
>
> Also, I took a look at the mapscript source code, and it seems that
> implementing a removeLayer() method shouldn't be to hard (I wouldn't
> mind
> taking a stab at it). Or do I miss something?
>
> Thanks for your help,
> Christoph
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list