var map = null; var baseIcon = null; var geocoder = new GClientGeocoder(); function loadMap() { if (GBrowserIsCompatible()) { document.getElementById('googleMap').style.display=''; map = new GMap2(document.getElementById('googleMap')); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); baseIcon = new GIcon(); baseIcon.image = 'http://www.google.com/mapfiles/marker.png'; baseIcon.shadow = 'http://www.google.com/mapfiles/shadow50.png'; baseIcon.iconSize = new GSize(20, 34); baseIcon.shadowSize = new GSize(37, 34); baseIcon.iconAnchor = new GPoint(9, 34); baseIcon.infoWindowAnchor = new GPoint(9, 2); baseIcon.infoShadowAnchor = new GPoint(18, 25);setPoint('Culligan Water Conditioning', ' 22183 State Rte 18 ', 'Defiance, OH 43512', 'waterexperts@bright.net', '419-782-9756');setPoint('Culligan Water Conditioning', ' 218 East High Street ', 'Bryan, OH 43506', '', '419-636-2236'); } } function createMarker(point, locName, locAddress, locCityStateZip, locEmail, locPhone) { var icon = new GIcon(baseIcon); var marker = new GMarker(point, icon); var html = "
" + locName + "
" + locAddress + "
" + locCityStateZip; if (locPhone != '') { html += "
" + locPhone; } if (locEmail != '') { html += "
" + locEmail + "

"; } html += "
" + "Starting Address:" + "
" + "
" + "
"; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); } ); return marker; } function setPoint(locName, locAddress, locCityStateZip, locEmail, locPhone) { geocoder.getLatLng( locAddress+' '+locCityStateZip, function(point) { if (!point) { alert(locAddress + ' not found.'); } else { map.setCenter(point, 10); var marker = createMarker(point, locName, locAddress, locCityStateZip, locEmail, locPhone); map.addOverlay(marker); } } ); } function getPoint(address, zoom, pan) { geocoder.getLatLng( address, function(point) { if (!point) { } else { if(pan==0) { map.setCenter(point, zoom); } else { map.panTo(point, zoom); map.setCenter(point, zoom); } } } ); }