Google services

From Code Trash
Jump to: navigation, search

Google Map

Map API Key for localhost

<script src=""

Simple google map - using address

Show a map of an address by converting the address to its lat lng. Create a information window for that marker so that when an user clicks on the marker a baloon info opens

var la, lo, point
function mapi(address)
    var geocoder = new GClientGeocoder ();	
    geocoder.getLatLng (address, function (point)
		document.getElementById('maps').innerHTML = "<p>Invalid Address</p>";
        la =;
        lo = point.lng();
		if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("maps"));
		map.addControl(new GLargeMapControl());
	    map.addControl(new GMapTypeControl(3));	
        map.setCenter(new GLatLng(la,lo), 17,G_HYBRID_MAP);	
		var pt = new GMarker(new GLatLng(parseFloat(la),parseFloat(lo))	)
        GEvent.addListener(pt, "click", function() 
			map.openInfoWindow(map.getCenter(),"<p style='color:black;'>aiyoo aiyoo</p>");

<div id='maps' style='width:500px; height:300px;'></div>

Weather API

Use this XML file for output in Fahrenheit:
And this one for Celsius: