Locatios Test - Super Lube





Simple Google map


addLoadEvent(loadMap);
addLoadEvent(addPoints);

function loadMap() {
map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng( 30.44689782587533, -84.25724029541015), 12);
map.setMapType(G_NORMAL_MAP);

icon0 = new GIcon();
icon0.image = "http://www.google.com/mapfiles/marker.png";
icon0.shadow = "http://www.google.com/mapfiles/shadow50.png";
icon0.iconSize = new GSize(20, 34);
icon0.shadowSize = new GSize(37, 34);
icon0.iconAnchor = new GPoint(9, 34);
icon0.infoWindowAnchor = new GPoint(9, 2);
icon0.infoShadowAnchor = new GPoint(18, 25);
}

function addPoints() {

newpoints[0] = new Array(30.454297001634202, -84.27955627441406, icon0, 'Location 1', 'info 1');
newpoints[1] = new Array(30.44689782587533, -84.27337646484375, icon0, 'Location 2', 'info 2');
newpoints[2] = new Array(30.448377705965697, -84.28367614746094, icon0, 'Location 3', 'Info 3');

for(var i = 0; i < newpoints.length; i++) {
var point = new GPoint(newpoints[i][1],newpoints[i][0]);
var popuphtml = newpoints[i][4] ;
var marker = createMarker(point,newpoints[i][2],popuphtml);
map.addOverlay(marker);
}
}

function createMarker(point, icon, popuphtml) {
var popuphtml = "

" + popuphtml + "<\/div>";
var marker = new GMarker(point, icon);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(popuphtml);
});
return marker;
}
//]]>