var map = null; var geocoder = null; var geocoder; var map; var address = "Suite 3, Level 1, 23 Chamberlain St Campbelltown, NSW 2560, Australia"; function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 14, center: latlng, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, navigationControl: true, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); if (geocoder) { geocoder.geocode({ 'address': address }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (status != google.maps.GeocoderStatus.ZERO_RESULTS) { map.setCenter(results[0].geometry.location); var infowindow = new google.maps.InfoWindow({ content: '' + address + '', size: new google.maps.Size(150, 50) }); var marker = new google.maps.Marker({ position: results[0].geometry.location, map: map, title: address }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); }); } else { alert("No results found"); } } else { alert("Geocode was not successful for the following reason: " + status); } }); } } google.maps.event.addDomListener(window, 'load', initialize); function showAddress(address,address_city , address_state , company) { } /* function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(37.4419, -122.1419), 14); geocoder = new GClientGeocoder(); } } function showAddress(address,address_city , address_state , company) { address_found = false; if (GBrowserIsCompatible()) { geocoder = new GClientGeocoder(); if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { //alert(address + " not found"); } else { address_found = true; var mapOptions = { googleBarOptions : { style : "new" } } map = new GMap2(document.getElementById("map_canvas"), mapOptions); map.setCenter(point, 14); map.setUIToDefault(); map.disableScrollWheelZoom(); map.enableGoogleBar(); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(company); //map.addControl(new GSmallMapControl()); } } ); */ /* if (address_found == false){ geocoder.getLatLng( address_city, function(point) { if (!point) { //alert(address + " not found"); } else { address_found = true; var mapOptions = { googleBarOptions : { style : "new" } } //map = new GMap2(document.getElementById("map_canvas"), mapOptions); map.setCenter(point, 14); map.setUIToDefault(); map.disableScrollWheelZoom(); map.enableGoogleBar(); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(company); } } ); }// end of city_address found if (address_found == false){ alert(address_found); geocoder.getLatLng( address_state, function(point) { if (!point) { //alert(address + " not found"); } else { address_found = true; var mapOptions = { googleBarOptions : { style : "new" } } //map = new GMap2(document.getElementById("map_canvas"), mapOptions); map.setCenter(point, 14); map.setUIToDefault(); map.disableScrollWheelZoom(); map.enableGoogleBar(); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(company); //map.addControl(new GSmallMapControl()); } } ); }// end ofaddress_state found */ /* } // if (geocoder) } // if (GBrowserIsCompatible()) } */