I think we can avoid all this piece of code and put itdirectly in `gaGlobalOptions` definition.
````
var mapUrl =  location.origin + '/${user_env}' ;
mapUrl : mapUrl
cachedMapUrl: mapUrl + '/${version}' 
ogcproxyUrl: mapUrl + '/ogcproxy?url='

````