"); var map, baseIcon; function load() { if ( document.getElementById('IsGPSSet').value == "True" ) { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); //map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(document.getElementById('RLat').value, document.getElementById('RLong').value), 11); // Create a base icon for all of our markers that specifies the // shadow, icon dimensions, etc. baseIcon = new GIcon(); 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); var restpoint = new GLatLng(document.getElementById('RLat').value, document.getElementById('RLong').value); var restaurantname = document.getElementById('restname').value; var points = new Array(); var pointsCount = 0; var polyline = new GPolyline(points, "#FF0000", 2); var restMarker = createMarker(restpoint, restaurantname, false, false); map.addOverlay(restMarker); points[0] = new GLatLng(document.getElementById("DLat1").value, document.getElementById("DLong1").value); points[1] = new GLatLng(document.getElementById("DLat2").value, document.getElementById("DLong2").value); //points[pointsCount] = points[0]; polyline = new GPolyline([ new GLatLng( points[0].y, points[0].x), new GLatLng( points[1].y, points[0].x), new GLatLng( points[1].y, points[1].x), new GLatLng( points[0].y, points[1].x), new GLatLng( points[0].y, points[0].x) ], "#FF0000", 2); //polyline = new GPolyline(points, "#FF0000", 2); map.addOverlay(polyline); } } else { alert("Error: GPS for the restaurant have not been set. Please contact the administrator."); //window.parent.location.replace(document.referrer); } } // Creates a marker whose info window displays the letter corresponding // to the given index. function createMarker(point, str, draggable, bouncy) { // Create a lettered icon for this point using our icon class var letter = String.fromCharCode(str.substring(0,1).charCodeAt(0)); var icon = new GIcon(baseIcon); icon.image = "http://www.google.com/mapfiles/marker" + letter + ".png"; var marker; var mkrOptions; if(draggable == true && bouncy == false) { mkrOptions = { icon: icon, dragCrossMove: false, clickable: true, draggable: true, bounceGravity: 1 }; marker = new GMarker(point, mkrOptions); } else if(draggable == true && bouncy == true) { mkrOptions = { icon: icon, dragCrossMove: false, clickable: true, draggable: true, bouncy: false, bounceGravity: 1 }; marker = new GMarker(point, mkrOptions); } else { marker = new GMarker(point, icon); } GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml("" + str + ""); }); return marker; } function IsRestInZone(restpoint, points) { if(((restpoint.x < points[0].x && restpoint.x > points[1].x) || (restpoint.x > points[0].x && restpoint.x < points[1].x)) && ((restpoint.y < points[0].y && restpoint.y > points[1].y) || (restpoint.y > points[0].y && restpoint.y < points[1].y))) { return true; } else { return false; } } -->