Example of calling Google map api using asp.net, Google api

Source: Internet
Author: User

Example of calling Google map api using asp.net, Google api

When asp.net calls the Google map api, pay attention to the sequence of js introduction. Copy the code to test it.

<Html xmlns =" http://www.w3.org/1999/xhtml "> <Head> <title> </title> // The sequence of js introduction <link href =" Mapjs/jquery.ui.base.css "rel =" external nofollow "rel = "stylesheet" type = "text/css"/> <link href = "Mapjs/jquery.ui.theme.css" rel = "external nofollow" rel = "stylesheet" type = "text/css "/> <script src = "jquery-1.9.1.js" type = "text/javascript"> </script> <script src = "Mapjs/jquery. ui. core. js "type =" text/javascript "> </script> <script src =" Mapjs/jquery. ui. widget. js "type =" text/javascript "> </script> <script src =" Mapjs/jquery. ui. position. js "type =" text/javascript "> </script> <script src =" Mapjs/jquery. ui. tooltip. js "type =" text/javascript "> </script> <link href =" Mapjs/demos.css "rel =" external nofollow "rel =" stylesheet "type =" text/css "/> <style type =" text/css ">. photo {width: 300px; text-align: center ;}. photo. ui-widget-header {margin: 1em 0 ;}. map {width: 350px; height: 350px ;}. ui-tooltip {max-width: 350px ;}</style> <script type = "text/javascript" >$ (function () {$ (document ). tooltip ({items: "img, [data-geo], [title]", content: function () {var element = $ (this); if (element. is ("[data-geo]") {var text = element. text (); return " ";} if (element. is ("[title]") {return element. attr ("title");} if (element. is ("img") {return element. attr ("alt") ;}}); $ ('# Button1 '). click (function () {$ ('# aname '). text ($ ('# text1 '). val (); $ ('# aname '). attr ('href '," http://maps.google.com/maps?q= "+ $ ('# Text1 '). val () + "& z = 11 ");})}); </script> 

You can click Copy to test


I want to know how aspnet can implement Google map API calling. I need to implement the function of displaying merchant addresses on maps like group buying online.

You apply for a google map api id. Then, you can add the example code they provided on the page. I have done it, and it is very simple. The Code has been given to someone. Not at hand. Is C.

Aspnet calls google Map

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "www.w3.org/..ct.dtd">

<Html xmlns = "www.w3.org/5o/xhtml" xmlns: v = "urn: schemas-microsoft-com: vml">

<Head>

<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8"/>

<Title> Google map JavaScript API example: simple Map </title>

<Script src = "ditu.google.cn/..w.zh-cn" type = "text/javascript"> </script>

<Script type = "text/javascript">

Function initialize (){

Var map = new GMap2 (document. getElementById ("map_container "));

Map. setCenter (new GLatLng (39.917, 116.397), 14 );

Map. enableDragging (); // enables the map to be dragged. The default setting is enabled.
Map. enableScrollWheelZoom (); // zoom the map with the mouse Pulley
Map. enableContinuousZoom (); // enable the animation effect when zoomed in or out.
Map. doubleClickZoomEnabled () // double-click the mouse to enlarge the map.
Map. addControl (new GSca ...... remaining full text>
 

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.