<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; CHARSET=GBK "/>
<title> Geographical coordinates transformation </title>
<script src= "Http://ditu.google.cn/maps?file=api&v=2&key=ABQIAAAAe3YR_ Ozq7rqougohleqyxrtrt8hriyvhgz6s-cexyhuhznmtnbqj3hrfcsvsmq_fqr80b62kdy8dja&sensor=true "
Type= "Text/javascript" ></script>
<script type= "Text/javascript" >
WINDOW.G = {};
window.$ = function (ID) {return document.getElementById (ID)};
Window.onload = function () {
if (gbrowseriscompatible ()) {
G.map = new GMap2 ($ ("map"));
Loading the Google Maps control
G.map.addcontrol (New Glargemapcontrol ());
G.map.addcontrol (New Gmaptypecontrol ());
G.map.addcontrol (New Gscalecontrol ());
Instantiate the Google client geocoding class (Gclientgeocoder)
G.geocoder = new Gclientgeocoder ();
G.getcoordinates = function (address) {
G.GEOCODER.GETLATLNG (
Address
function (point) {
if (point) {
Alert (Point.lat ());
Alert (POINT.LNG ());
G.map.setcenter (point, 13);
var marker = new Gmarker (point);
G.map.addoverlay (marker);
var info = "<strong>" + address + "</strong><br/> Coordinates:" + point.lat () + "," + point.lng ();
$ ("info"). InnerHTML = info;
Marker.openinfowindowhtml (info);
Marker.__address_info = info;
Gevent.addlistener (Marker, "click", Function () {
G.map.setcenter (THIS.GETLATLNG ());
This.openinfowindowhtml (This.__address_info);
$ ("info"). InnerHTML = info;
});
}
else {
Alert ("Unable to parse:" + address);
}
}
)
}
$ ("Btn_go"). onclick = function () {
G.getcoordinates ($ ("address"). Value);
}
$ ("Btn_go"). OnClick ();
}
else {
Alert (' unsupported browser ');
}
}
Window.onunload = function () {
Gunload ();
}
</script>
<style media= "Screen" >
Body
{
margin:0;
padding:0;
font-size:9pt;
Line-height:1.5em;
}
#frame
{
width:700px;
margin:20px Auto 10px;
}
#form
{
margin:0 0 10px;
Text-align:center;
}
#form input
{
border:1px solid #ccc;
font-size:9pt;
width:200px;
}
#form button
{
font-size:9pt;
border:1px solid #ccc;
}
#form Button:hover
{
Background: #eef;
}
#map
{
height:400px;
margin:0 0 10px;
border:5px solid #ccc;
}
#vifix
{
Text-align:center;
}
#vifix A
{
Color: #f00;
Text-decoration:none;
}
#vifix a:hover
{
Color: #f96;
}
</style>
<body>
<div id= "Frame" >
<div id= "Form" >
Enter an address:
<input id= "Address" value= "Hangzhou Xihu Three ponds printing month"/>
<button id= "Btn_go" >
Get coordinates </button>
</div>
<div id= "Map" >
</div>
<div id= "Info" >
</div>
<div id= "Vifix" >
Powered by <a href= "http://code.google.com/apis/maps/" target= "_blank" >google Map api</a>
/Created by <a href= "http://vifix.cn%22%3evifix.cn%3c/a>
</div>
</div>
</body>
Call the full version of Google Maps