Introduction of GoogleMap to ASP. NET

Source: Internet
Author: User

Hey, let's not talk about anything. Submit the source code for more advice!

 

 

<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. CS "inherits =" _ default "%> </P> <p> <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br/> <HTML xmlns = "http://www.w3.org/1999/xhtml"> <br/> <pead> <br/> <% -- load the local search style -- %> <br/> <MCE: style type = "text/CSS"> <! -- <Br/> @ import URL ("http://www.google.com/uds/css/gsearch.css"); <br/> @ import URL ("http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css"); <br/>}< br/>. style1 {<br/> font-size: 12px; <br/> color: #003366; <br/>}</P> <p> --> </MCE: style> <style type = "text/CSS" mce_bogus = "1"> @ import URL ("http://www.google.com/uds/css/gsearch.css"); <br/> @ import URL ("http://www.google.com/uds/solution ") S/localsearch/gmlocalsearch.css "); <br/>}< br/>. style1 {<br/> font-size: 12px; <br/> color: #003366; <br/>}< br/> </style> <br/> <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 "/> <br/> <title> Google map introduction </title> <br/> <% -- Google Maps API enables you to embed Google Maps into your webpage. A map API key is valid only for one "directory" or domain. <Br/> 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. <Br/> Please apply for a http://code.google.com/intl/zh-CN/apis/maps/signup.html--% here> <br/> <MCE: script src = "http://maps.google.com/maps? File = API & V = 2 & Key = ABQIAAAAomgcdg9DjL60HKYl-1QbnhRhywW8vKZVMFuSsAE3Eu0YRdhAXhTcj2-jOXN4Kbz6pCI4DnVhXqqW6g "mce_src =" http://maps.google.com/maps? File = API & V = 2 & Key = ABQIAAAAomgcdg9DjL60HKYl-1QbnhRhywW8vKZVMFuSsAE3Eu0YRdhAXhTcj2-jOXN4Kbz6pCI4DnVhXqqW6g "<br/> type =" text/JavaScript "> </MCE: SCRIPT> <br/> <MCE: script src = "http://www.google.com/uds/api? File = UDS. JS & V = 1.0 "mce_src =" http://www.google.com/uds/api? File = UDS. JS & V = 1.0 "type =" text/JavaScript "> </MCE: SCRIPT> <br/> <MCE: script src = "http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" mce_src = "http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js" type = "text/JavaScript"> </MCE: SCRIPT> <br/> <MCE: script Type = "text/JavaScript"> <! -- <Br/> var geocoder = NULL; <br/> function load () {<br/> If (gbrowseriscompatible ()) {<br/> // a map is enabled. <br/> var map = new gmap2 (document. getelementbyid ("map"); <br/> // map center location <br/> map. setcenter (New glatlng (34.81552976499691, 113.6833906173706), 13); <br/> // enables the mouse zoom function <br/> map. enablescrollwheelzoom (); <br/> // disable the mouse zoom function <br/> // map. disablescrollwheelzoom (); <br/> // a local search location <br/> map. addcontrol (new Google. maps. localsearch (), new gcontrolposition (g_anchor_bottom_right, new gsize (-260, 0); <br/> // Add a satellite <br/> map. addcontrol (New glargemapcontrol (); <br/> // Add a Map <br/> map. addcontrol (New gmaptypecontrol (); <br/> // the pan and zoom controls (upper left corner) <br/> map. addcontrol (New glargemapcontrol (); <br/> //, scale replacement (lower left) <br/> map. addcontrol (New gscalecontrol (); <br/> //, Thumbnail Control (lower left) <br/> map. addcontrol (New goverviewmapcontrol (); <br/> // enables mouse dragging <br/> map. enabledragging (); <br/>}< br/> // --> </MCE: SCRIPT> <br/> </pead> <br/> <body onload = "load ()" onUnload = "gunload () "> <br/> <% -- load the map here -- %> <br/> <Div id =" map "style =" width: 720px; height: 500px "> <br/> </div> <br/> </body> <br/> </ptml> <br/>

 

:

 

For the hard work, I hope to find the source .. Thank you!

Related Article

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.