4

I'm using Mapscript reading a configuration of my map file, so i set some values in my mapObj. But in certain point of my code i need to restore the default values locate in map file. I tried to use the method "applyConfigOptions()", but didn't work. Is there a way to do that?

  • Can't you just reread the original MAP file again? – geographika May 31 '11 at 7:23
1

I'm a mapscript developer and I'm afraid that's not possible with the stock mapscript.

You should implement the Memento pattern in your code as described here or you could use the clone() method to obtain a snapshot of the mapObj state to which you can eventually revert to. Safest option is to implement Memento. clone() might not work of even crash your program.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.