detecting center of map