[nim, argha] Fixed and refactored OpenLayers logic in  mapping javascript