var map; var geocoder = new GClientGeocoder(); function load(streetaddr,city,state,zip) { var baseIcon = new GIcon(); baseIcon.iconSize=new GSize(32,32); baseIcon.shadowSize=new GSize(56,32); baseIcon.iconAnchor=new GPoint(16,32); baseIcon.infoWindowAnchor=new GPoint(16,0); var destinationIcon; destinationIcon=new GIcon(baseIcon, "/images/icons/highway.png", null, "/images/icons/highways.png"); if (GBrowserIsCompatible()) { //setup the loading message var coors = findPos(document.getElementById("map")); document.getElementById("maploading").style.left = coors[0] + 'px'; document.getElementById("maploading").style.top = coors[1] + 'px'; map = new GMap2(document.getElementById("map"),{ draggableCursor: 'pointer' }); var address= streetaddr + ' ' + city + ' ' + state + ' ' + zip; var evtpoint; //First see if the whole address converts to lat lng, if not just see if //you can find the street address and the zip. geocoder.getLatLng(trim(address), function(point) {evtpoint=point; }); if (!evtpoint) { geocoder.getLatLng(trim(streetaddr+' ' + zip), function(point) { if (!point) { //alert('The location of this event could not be found on the map.'); document.getElementById("locnotfound").style.left = coors[0] + 'px'; document.getElementById("locnotfound").style.top = coors[1] + 'px'; document.getElementById('locnotfound').style.display="block"; map.setCenter(new GLatLng(35.0424, -89.9767), 3); } else { map.setCenter(point, 7); //overlays.push(new GMarker(point, destinationIcon)); map.addOverlay(new GMarker(point, destinationIcon)); map.addControl(new GSmallMapControl()); }}); } else { map.setCenter(evtpoint, 14); map.addOverlay(new GMarker(evtpoint, destinationIcon)); } //Close the loading message after finished loading the map document.getElementById('maploading').style.display="none"; } else { //direct user to obtain a compatible browser location.href = '/updatebrowser.asp'; } }