var address = $("#address").val() + ", " + document.getElementById("city_i").value + ", " + $("#state option:selected").html() + ", " + $("#country option:selected").html(); if (geocoder) { geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); } else { alert("Geocode was not successful for the following reason: " + status); } }); } } function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(<?php echo $e->prepareEconomicUnitLatitude(); ?> ,<?php echo $e->prepareEconomicUnitLongitude(); ?> ); var myOptions = { zoom: 16, center: latlng, mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP } x = latlng.toString(); x = x.split(",");