1 <head> 2 <style> 3 body { 4 margin: 0px; 5 padding: 0px; 6 } 7 #map { 8 width: 512px; 9 height: 512px; 10 } 11 </style> 12 <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAATfHumDbW3OmRByfquHd3SRTRERdeAiwZ9EeJWta3L_JZVS0bOBRQeZgr4K0xyVKzUdnnuFl8X9PX0w&sensor=false" 13 type="text/javascript"></script> 14 <script> 15 var maps_key = "ABQIAAAATfHumDbW3OmRByfquHd3SRTRERdeAiwZ9EeJWta3L_JZVS0bOBRQeZgr4K0xyVKzUdnnuFl8X9PX0w"; 16 17 function gclient_geocode(address) { 18 var geocoder = new GClientGeocoder(); 19 geocoder.getLatLng(address, function(point) { 20 if (!point) { 21 console.log(address + " not found"); 22 } else { 23 var latlng = point.toUrlValue(); 24 var url = "http://maps.google.com/staticmap?center=" + latlng + 25 "&markers=" + latlng + "&zoom=14" + 26 "&size=512x512&sensor=false&key=" + maps_key; 27 var map = document.getElementById("map"); 28 map.src = url; 29 } 30 }); 31 } 32 33 function map() { 34 var address = chrome.extension.getBackgroundPage().selectedAddress; 35 if (address) 36 gclient_geocode(address); 37 }; 38 </script> 39 </head> 40 <body onload="map()"> 41 <img id="map" onclick="window.close()"> 42 </body> 43