Global Mapper Pro

UNLOAD_LAYER unloading all instances

veddycent
veddycent Global Mapper User
Hi all,

I'm trying to unload a group via script but seen as there is no way of doing that (not that I'm aware of) I'm looping through the group and unloading each layer one by one. Unfortunately this closes every instance of that layer, even when the instances which are in different groups.

Here is the script:
LAYER_LOOP_START FILENAME="Group2<sub>*.shp" 
UNLOAD_LAYER FILENAME="%LAYER_FNAME_W_DIR%"
LAYER_LOOP_END

This is the hierarchy structure:
Group1 - Start
---Shape file 1.shp
---Shape file 2.shp
---Shape file 3.shp
Group1 - End

Group2 - Start
---Shape file 1.shp
---Shape file 2.shp
---Shape file 3.shp
Group2 - End

After the script finishes all layers have been closed.

I haven't found anything in the documentation or on the forums, am I missing anything?

Regards
Ved

Best Answer

  • bmg_bob
    bmg_bob Global Mapper Programmer
    Accepted Answer
    Hello Ved,

    Please give this a try:
    UNLOAD_LAYER FILENAME="Group2<sub>%LAYER_FNAME_W_DIR%"
    I ran a quick test and it worked for me.

    Cheers,
    Bob

Answers

  • veddycent
    veddycent Global Mapper User
    I can't believe I hadn't tried that :s

    Much appreciated!
    Thank you!
Sign In or Register to comment.