Call the full version of Google Maps

Source: Internet
Author: User

<! 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&amp;v=2&amp;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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.