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>