您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關(guān)谷歌地圖api怎么利用asp.net進(jìn)行調(diào)用,小編覺(jué)得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說(shuō),跟著小編一起來(lái)看看吧。
實(shí)現(xiàn)方法如下:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title>//在這里要注意js引入的先后順序 <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 "<img class='map' alt='" + text + "' src='http://maps.google.com/maps/api/staticmap?" + "zoom=11&size=350x350&maptype=terrain&sensor=false¢er=" + text + "'>"; } 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> </head> <body> <div class="ui-widget photo"> <div class="ui-widget-header ui-corner-all"> <input id="Text1" type="text" value="China,上海" /><input id="Button1" type="button" value="設(shè)置" /> <h4> <a href="http://maps.google.com/maps?q=China,上海&z=11" rel="external nofollow" data-geo id="AName">China,上海</a></h4> </div> </div> </body> </html>
以上就是谷歌地圖api怎么利用asp.net進(jìn)行調(diào)用,小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見(jiàn)到或用到的。希望你能通過(guò)這篇文章學(xué)到更多知識(shí)。更多詳情敬請(qǐng)關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。