title: How to center a google map around a country if you just have the country name
body: <p>I have a page about hiking in various countries.  I am trying to make a page like that for each country, but not sure how to automatically center the google map around a country and also have it adjust the focus depending on the size of the country.</p>
  
  <p>Here are my problem pages:</p>
  
  <p><a href="http://www.comehike.com/outdoors/country.php?country_id=6&amp;country_name=Belarus">http://www.comehike.com/outdoors/country.php?country_id=6&amp;country_name=Belarus</a></p>
  
  <p><a href="http://www.comehike.com/outdoors/country.php?country_id=1&amp;country_name=United%20States">http://www.comehike.com/outdoors/country.php?country_id=1&amp;country_name=United%20States</a></p>
  
  <p>You see how the centering and focus size is static?  That is because I currently use this code to center the map:</p>
  
  <pre><code>function initialize( )
  {
      var myLatlng = new google.maps.LatLng(37.775, -122.4183333);
  
      var myOptions =
      {
        zoom: 2,
        center: myLatlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      }
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  }
  </code></pre>
  
  <p>But that is only because I am not sure how to do it by country name, and adjust the size automatically.  How can I do this all by passing a country name into the initialize function?</p>
  
  <p>Thanks!</p>