Hi Tamas,
I am using the binary downloaded here: (MS4W 2.1)
I noticed that there is a new beta source version, but I do not compile it yet.
I do not tried with the other hard coded layers, but I think it may have the same problem, here is the code caused the strange problems:
1. this works well with index: -- insertLayer
objMapping.insertLayer(objMapTemp, shapeRegionLayer, objMapping.getLayerIndex(
"France_Departements", objMapTemp) + 1)-- the last parameter is the index value I used to insert the inline layer "shapeRegionLayer", the layer "France_Departements" is a hard coded layer in mapfile.
2. but I am not so lucky enough with this one: -- insertLayer
objMapping.insertLayer(objMapTemp, shapeCommunesLayer, 11)
-- here only the index value -1 works, any other value will cause exceptions like: msFreeHashItems(): hash table error.
3. this does not work:
Dim
tempLayer As layerObj = objParentMap.getLayerByName(strLayerName) Dim intIndex As Integer = tempLayer.index ()objParentMap.removeLayer(intIndex)
I will test the removeLayer method again with a hard coded layer.
Do you have any other ideas to remove a layer from the map object?
Thanks
Zhonghai
On 8/28/06, Tamas Szekeres <[EMAIL PROTECTED]> wrote:
Zhonghai,
There was problem with insertLayer according to
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1838
The problem was recently fixed (4.10.0-beta1 should contain the fix).
Is the removeLayer problem also exist for the other layers? (not for
the dynamically added layers)
Which mapserver version are you using?
Could you include a code sample according to the problem?
Tamas
2006/8/28, Zhonghai Wang <[EMAIL PROTECTED] >:
>
> Hi guys,
>
> I am trying to remove an inline feature using the map.removeLayer(index),
> but it seems that this method does not work. The inline feature layer is
> created on the fly, not in the mapfile hard coded. Does anyone ever used
> this function successfully? There may also be some problems with the
> map.insertLayer(layerObj, index), only map.insertLayer(layerObj,-1) works
> for me, I can not specify the index.
>
>
> thanks for any hints to solve my problem.
>
>
> Zhonghai
>
