Mapscript API: for object manipulation, not object creation?

Rick Innis rick at INNIS.CA
Mon May 30 16:19:37 PDT 2005


> I'm looking at mapObj.java generated using SWIG 1.3.21 and
> MapServer 4.4. Should be what you get out of the box. I see a
>
>   public int insertLayer(layerObj layer, int index)
>

Which is what I have...


> Once again I forgot that there are no optional method arguments for
> Java. Sorry. In the Python mapscript, this method's signature is
>
>   insertLayer(layer, index=-1)
>
> and we can omit the index, it defaults to -1, or the end of the
> layers list.
>

Had I the time to rewrite this app in Python, I would :-)


> In your case, insert a layer at the end with
>
>   li = map.insertLayer(layer, -1)
>

OK - I was using

map.insertLayer(layer, map.getNumlayers())

naively assuming it would insert at the appropriate index. Thanks.


> Which version of SWIG are you using?
>

SWIG 1.3.24
Mapserver 4.4.2

Things seem to be working now...I'm letting a stress test run so
we'll see how that works. (It's just curl in a while loop, but it
does the trick.)

Thanks,

     --Rick.



More information about the MapServer-users mailing list