Creation of layer object in Python Maps cript

Sean Gillies sgillies at FRII.COM
Thu Oct 28 13:14:48 EDT 2004


On Oct 28, 2004, at 11:03 AM, Ryan, Adam wrote:

>> -----Original Message-----
>> From: Bill Hudspeth [mailto:bhudspeth at EDAC.UNM.EDU]
>> Sent: Thursday, October 28, 2004 8:56 AM
>> To: MAPSERVER-USERS at LISTS.UMN.EDU
>> Subject: [UMN_MAPSERVER-USERS] Creation of layer object in
>> Python Mapscript
>>
>>
>> Hello,
>>
>> I want to write new map layers on the fly in my scripting. I
>> have found the reference to "new layerObj()" in the
>> documentation, but am unsure of how to write the exact
>> syntax. Haven't had any luck with "new_layer=layerObj(mapObj)".
>>
>> Any help greatly appreciated.
>>
>> Bill
>>
>
> Hi Bill,
>
> I'm working on the same thing 'bout now.
> For me, this crashes Python:
>
>     layerO = mapscript.layerObj(mapO)
>
> But this works OK:
>
>     layerO = mapscript.layerObj()
>     mapO.insertLayer(layerO)
>
> However, if I then check layerO.index, I get 1634300513.  That's a lot
> of
> layers.
>
> If I check mapO.getLayersDrawingOrder(), I get _30fc8200_p_int.  Is
> this a
> typemap issue?
>
> If I try layerO.promote() or layerO.demote(), I'm told those methods
> don't
> exist.
>
> I'm still trying to figure this one out.  Let me know if you make any
> headway.
>
> Adam
>
>

Which version of mapserver are y'all using?

Sean



More information about the mapserver-users mailing list