var map;
var geocoder;
function initialize() {
  var map_e = document.getElementById('project_map');
  if (map_e != null) {
    geocoder = new google.maps.Geocoder();
    var address = map_e.getAttribute('data-city') + ', ' + map_e.getAttribute('data-country');
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        var myOptions = {
          zoom: 1,
          center: results[0].geometry.location,
          streetViewControl: false,
          mapTypeControl: false,
          mapTypeId: google.maps.MapTypeId.SATELLITE
        }
        map = new google.maps.Map(map_e, myOptions);
        var marker = new google.maps.Marker({
          map: map,
          position: results[0].geometry.location
        });
      }
    });
  }
}
google.maps.event.addDomListener(window, 'load', initialize);

