Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

1 Answer 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.

share|improve this answer

Your Answer

 
discard

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.