jQuery实现网页引用百度地图实例代码
在很多网站都有对百度地图的引用,非常的方便,本章节就是一个一个这样的代码实例。
默认状态,引用的地图上有版权信息,不但不美观也会遮挡一些信息,本代码也能够去除那些没用的信息。
代码实例如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <meta name="author" content="http://www.gaodaima.com/" /> <title>移除百度地图版权信息-搞代码</title> <style type="text/css"> #map{ width:400px; height:400px } </style> <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"> <script src="http://api.map.baidu.com/api?v=1.3" type="text/javascript"></script> <script type="text/javascript"> function initialize(){ var mp = new BMap.Map('map'); mp.centerAndZoom(new BMap.Point(121.491, 31.233),11); } $(document).ready(function(){ initialize(); $("#bt").click(function(){ $('#map div.anchorBL').hide(); }) }) </script> </head> <body> <input type="button" id="bt" value="移除地图LOGO和版权说明"/> <div id="map"></div> </body> </html> |
以上代码实现了我们需要的功能,能够在网页中引用指定坐标的地图。
原创文章,转载请注明: 转载自搞代码
本文链接地址: jQuery实现网页引用百度地图实例代码

微信 赏一包辣条吧~

支付宝 赏一听可乐吧~
发表评论