compute center in the map, and add some rails settings