The Google Maps code is open. Do you want to introduce the map to your website !!!

Source: Internet
Author: User

 

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">

<% -- Load the local search style -- %>
<Style type = "text/css">
@ Import url ("http://www.google.com/uds/css/gsearch.css ");
@ Import url ("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css ");
}
. STYLE1 {
Font-size: 12px;
Color: #003366;
}
</Style>
<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8"/>
<Title> sufei wishes you a safe journey </title>
<% -- Google Maps API enables you to embed Google Maps into your webpage. A map API key is valid only for one "directory" or domain.
For more information, see this FAQ. You must have a Google account to obtain the Maps API key, which is associated with your Google account.
Please apply for a http://code.google.com/intl/zh-CN/apis/maps/signup.html--% here>
<Script src = "http://maps.google.com/maps? File = api & amp; v = 2 & amp; key = ABQIAAAAomgcdg9DjL60HKYl-1QbnhRhywW8vKZVMFuSsAE3Eu0YRdhAXhTcj2-jOXN4Kbz6pCI4DnVhXqqW6g"
Type = "text/javascript"> </script>
<Script src = "http://www.google.com/uds/api? File = uds. js & amp; v = 1.0 "type =" text/javascript "> </script>
<Script src = "http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
// <! [CDATA [
Var geocoder = null;
Function load (){
If (GBrowserIsCompatible ()){
// Enable a map
Var map = new GMap2 (document. getElementById ("map "));
// Location of the map center
Map. setCenter (new GLatLng (34.81552976499691, 113.6833906173706), 13 );
// Enable the mouse zoom Function
Map. enableScrollWheelZoom ();
// Disable the mouse zoom Function
// Map. disableScrollWheelZoom ();
// A local search location
Map. addControl (new google. maps. LocalSearch (), new GControlPosition (G_ANCHOR_BOTTOM_RIGHT, new GSize (-260,0 )));
// Add a satellite
Map. addControl (new GLargeMapControl ());
// Add a map
Map. addControl (new GMapTypeControl ());
// The pan and zoom controls (upper left corner)
Map. addControl (new GLargeMapControl ());
//, Scale replacement (lower left)
Map. addControl (new GScaleControl ());
//, Thumbnail Control (lower left corner)
Map. addControl (new GOverviewMapControl ());
// Enable mouse dragging
Map. enableDragging ();
}
}
//]>
</Script>
</Head>
<Body onload = "load ()" onunload = "GUnload ()">
<% -- Load the map here -- %>
<Div id = "map" style = "width: 720px; height: 500px"> </div>
</Body>
</Html>

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.