Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Can't you just reread the original MAP file again? – geographika May 31 '11 at 7:23

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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