Partially loaded script

Yann DUPUY
Yann DUPUY Global Mapper UserTrusted User

Hi,

using GM_LoadLayerList I'm trying to load some layers from a .gmw file.

Whenever a file is missing, I have a pop up dialog asking whether I want to select a new location or skip the file. If I skip the file, a new popup asks whether to cancel the entire operation or not. If I continue, the script continues to load, but in the end, the GM_LoadLayerList function returns an error 63 (Error_Script) and an empty layer list.

I was expecting the function to return the layers that were properly loaded. Is there any other method to call to achieve that goal ? Or from the API, the slightest error prevents the correct layers to be loaded ?

Thanks

Best Answer

  • bmg_mike
    bmg_mike Global Mapper Guru Moderator, Trusted User
    Answer ✓

    I can see the issue that you are referring to and have created internal task GMSDK-648 to address it.

    What you could do in this case is call GM_GetLoadedLayerList before and after the call and using the number of loaded layers before and after extract the layer handles of the newly loaded layers.

    Thanks,

    Mike

    Global Mapper Guru

Answers

  • Yann DUPUY
    Yann DUPUY Global Mapper User Trusted User

    As expected this is exactly what I needed.

    Thanks a lot,

    Yann