大佬教程收集整理的这篇文章主要介绍了如何使用jQuery Mobile显示全屏谷歌地图?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<!DOCTYPE html> <html> <head> <title>My Page</title> <Meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="stylesheet" href="css/jquery.mobile-1.1.0.min.css" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script src="js/jquery-1.7.1.min.js"></script> <script src="js/jquery.mobile-1.1.0.min.js"></script> <script type="text/javascript" src="js/jquery.ui.map.min.js"></script> </head> <body> <div data-role="page"> <div data-role="header"> <h1>My title</h1> </div><!-- /header --> <div data-role="content" id="map_canvas" name="contentMain"> </div><!-- /content --> </div><!-- /page --> <script> $('#map_canvas').gmap().bind('init',function() { // This URL won't work on your localhost,so you need to change it // see http://en.wikipedia.org/wiki/Same_origin_policy $.getJSON( 'http://jquery-ui-map.googlecode.com/svn/trunk/demos/json/demo.json',function(data) { $.each( data.markers,function(i,marker) { $('#map_canvas').gmap('addMarker',{ 'position': new google.maps.LatLng(marker.latitude,marker.longitudE),'bounds': true }).click(function() { $('#map_canvas').gmap('openInfoWindow',{ 'content': marker.content },this); }); }); }); }); </script> </body> </html>
输出:
提前致谢.
以上是大佬教程为你收集整理的如何使用jQuery Mobile显示全屏谷歌地图?全部内容,希望文章能够帮你解决如何使用jQuery Mobile显示全屏谷歌地图?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。