two mapscript questions

Jameson Tweedie jameson at topozone.com
Fri Feb 2 12:28:20 EST 2001


Thanks Steve, 
I am dealing entirely with simply user functionality on the web i.e.
interactivity and drawing to the browser.  I was wondering about
deletion, because it seemed to me that drawing performance was effected
by simply having a layer in a map, even if it was turned off (recently i
was using MapXtreme and that was a serious problem there when there were
raster images in the geoset, even if those layers were turned off) but i
just tested this and it's not a problem in MapServer so that's good!  
Reordering the layers was again just for user functionality, and having
the ability  for the user to reorder layers on the fly can be quite
handy especially when new layers are being added by the user and the
existing map order may no longer make sense, although using a list to
draw each layer in order would be entirely simple, i just hadn't thought
of it yet! 
Thanks, although i do think having an order function could be quite
useful.
Jameson.

-----Original Message-----
From: Stephen Lime [mailto:steve.lime at dnr.state.mn.us]
Sent: Friday, February 02, 2001 11:18 AM
To: Mapserver User Listserve (E-mail); Jameson Tweedie
Subject: Re: two mapscript questions


Not stupid questions, and not possible directly with the current
mapscript 
implementation. Deletion isn't that big of a deal since you can always
turn 
a layer off. Changing order is harder and is complicated by the
underlying 
storage in C.

There are work arounds. In MapScript you could manage order in the
scripting 
language using a list of layer names and then use that to direct drawing
order. For
example in perl:

@layers = ('roads', 'landcover', 'cities');

foreach $layername (@layers);
  $layer = $map->getLayerByName($layername);
  $layer->draw(...);
}

draws layers in an order defined by you and not the order in the
mapfile. 

In what context (i.e. drawing, writing mapfiles) are you needing these
functions?
I see where improvements could be made with respect to writing. There is
only
a single method for writing and I see a need to expose object specific
write()
methods, at least for layers.

I have experimented with an "ORDER ..." parameter that allowed you to
change
processing order by shuffling that array. It proved cumbersome to use
though in
practice so I removed it.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Jameson Tweedie" <jameson at topozone.com> 02/02/01 09:32AM >>>
hi, i have two quick (and presumably incredibly simple, pardon my
stupidity) questions:

1. can you remove a layer from a mapObj using mapscript?
2. can you change a layers position within a mapObj using mapscript?

i've checked through all the mapscript documentation i can get my hands
on and haven't seen an solution.  it would seem logical that they both
exist and to me the most logical option for the changing layers would be
to simply be able to change a layers index value, but that seems to be
read only. how do i go about doing these?
thanks jameson.




More information about the mapserver-users mailing list