Better handling of error cases in map.js
Currently, when requests return errors in map.js, errors are handled correctly, but in a way that's a bit messy (lots of booleans all over the place). This should be clarified to facilitate future maintenance.