BVB Source Codes

Easy to point the content management system DianCMS v6.0.0 SQL version Show show.html Source code

Return Download Easy to point the content management system DianCMS v6.0.0 SQL version: download show.html Source code - Download Easy to point the content management system DianCMS v6.0.0 SQL version Source code - Type:.html
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5.     <meta charset="utf-8"/>
  6.     <meta name="keywords" content="百度地图,百度地图API,百度地图自定义工具,百度地图所见即所得工具"/>
  7.     <meta name="description" content="百度地图API自定义地图,帮助用户在可视化操作下生成百度地图"/>
  8.     <title>百度地图API自定义地图</title>
  9.     <!--引用百度地图API-->
  10.     <style type="text/css">
  11.         html, body {
  12.             margin: 0;
  13.             padding: 0;
  14.             overflow: hidden;
  15.         }
  16.     </style>
  17.     <script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
  18. </head>
  19.  
  20. <body onload="initMap();">
  21. <!--百度地图容器-->
  22. <div style="width:697px;height:550px;border:#ccc solid 1px;" id="dituContent"></div>
  23. </body>
  24. <script type="text/javascript">
  25.     function getParam(name) {
  26.         return location.href.match(new RegExp('[?#&]' + name + '=([^?#&]+)', 'i')) ? RegExp.$1 : '';
  27.     }
  28.     var map, marker;
  29.     var centerParam = getParam('center');
  30.     var zoomParam = getParam('zoom');
  31.     var widthParam = getParam('width');
  32.     var heightParam = getParam('height');
  33.     var markersParam = getParam('markers');
  34.     var markerStylesParam = getParam('markerStyles');
  35.  
  36.     //创建和初始化地图函数:
  37.     function initMap() {
  38.         // [FF]切换模式后报错
  39.         if (!window.BMap) {
  40.             return;
  41.         }
  42.         var dituContent = document.getElementById('dituContent');
  43.         dituContent.style.width = widthParam + 'px';
  44.         dituContent.style.height = heightParam + 'px';
  45.  
  46.         createMap();//创建地图
  47.         setMapEvent();//设置地图事件
  48.         addMapControl();//向地图添加控件
  49.  
  50.         // 创建标注
  51.         var markersArr = markersParam.split(',');
  52.         var point = new BMap.Point(markersArr[0], markersArr[1]);
  53.         marker = new BMap.Marker(point);
  54.         marker.enableDragging();
  55.         map.addOverlay(marker); // 将标注添加到地图中
  56.  
  57.         if(parent.editor && parent.document.body.contentEditable=="true") { //在编辑状态下
  58.            setMapListener();//地图改变修改外层的iframe标签src属性
  59.         }
  60.     }
  61.  
  62.     //创建地图函数:
  63.     function createMap() {
  64.         map = new BMap.Map("dituContent");//在百度地图容器中创建一个地图
  65.         var centerArr = centerParam.split(',');
  66.         var point = new BMap.Point(parseFloat(centerArr[0]), parseFloat(centerArr[1]));//定义一个中心点坐标
  67.         map.centerAndZoom(point, parseInt(zoomParam));//设定地图的中心点和坐标并将地图显示在地图容器中
  68.     }
  69.  
  70.     //地图事件设置函数:
  71.     function setMapEvent() {
  72.         map.enableDragging();//启用地图拖拽事件,默认启用(可不写)
  73.         map.enableScrollWheelZoom();//启用地图滚轮放大缩小
  74.         map.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写)
  75.         map.enableKeyboard();//启用键盘上下左右键移动地图
  76.     }
  77.  
  78.     //地图控件添加函数:
  79.     function addMapControl() {
  80.         //向地图中添加缩放控件
  81.         var ctrl_nav = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE});
  82.         map.addControl(ctrl_nav);
  83.         //向地图中添加缩略图控件
  84.         var ctrl_ove = new BMap.OverviewMapControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: 1});
  85.         map.addControl(ctrl_ove);
  86.         //向地图中添加比例尺控件
  87.         var ctrl_sca = new BMap.ScaleControl({anchor: BMAP_ANCHOR_BOTTOM_LEFT});
  88.         map.addControl(ctrl_sca);
  89.     }
  90.  
  91.     function setMapListener() {
  92.         var editor = parent.editor, containerIframe,
  93.             iframes = parent.document.getElementsByTagName('iframe');
  94.         for (var key in iframes) {
  95.             if (iframes[key].contentWindow == window) {
  96.                 containerIframe = iframes[key];
  97.                 break;
  98.             }
  99.         }
  100.         if (containerIframe) {
  101.             map.addEventListener('moveend', mapListenerHandler);
  102.             map.addEventListener('zoomend', mapListenerHandler);
  103.             marker.addEventListener('dragend', mapListenerHandler);
  104.         }
  105.  
  106.         function mapListenerHandler() {
  107.             var zoom = map.getZoom(),
  108.                 center = map.getCenter(),
  109.                 marker = window.marker.getPoint();
  110.             containerIframe.src = containerIframe.src.
  111.                 replace(new RegExp('([?#&])center=([^?#&]+)', 'i'), '$1center=' + center.lng + ',' + center.lat).
  112.                replace(new RegExp('([?#&])markers=([^?#&]+)', 'i'), '$1markers=' + marker.lng + ',' + marker.lat).
  113.                replace(new RegExp('([?#&])zoom=([^?#&]+)', 'i'), '$1zoom=' + zoom);
  114.             editor.fireEvent('saveScene');
  115.         }
  116.     }
  117. </script>
  118. </html>
downloadshow.html Source code - Download Easy to point the content management system DianCMS v6.0.0 SQL version Source code
Related Source Codes/Software:
Ray speed v7.0 wage query system - To modify the software to conduct a comprehensive ... 2016-08-19
Address book v1.0 FaLiang three layer - This Demo is a three layer address book source cod... 2016-08-19
Deng Xi v2.4 website help system - Deng Xi website help system is a very useful help ... 2016-08-19
1.0 housing, rental housing sale platform - Rent housing rent out platform is a very typical r... 2016-08-19
Cloud on the CMS (SyCms) v1.95 - Add menus and blocks the system style functionalit... 2016-08-19
KesionICMS intelligent website system (school) v3.7 formal version - For school management web site, the kesion forward... 2016-08-19
KesionICMS intelligent website system (enterprise edition) v3.7 formal version - KesionICMS intelligent website (enterprise edition... 2016-08-19
KesionICMS intelligent website system (government) v3.7 formal version - Government Portal website construction Establish t... 2016-08-19
KesionICMS intelligent website system (gm) v3.7 formal version - KESIONICMS intelligent building systems with a fle... 2016-08-19
KesionIMALL v3.7 formal version online mall system - KESIONIMALLV3.7 online shop system, as a new e-com... 2016-08-19
fatfree - A powerful yet easy-to-use PHP micro-framework des... 2017-05-13
TSA-Travel-Sentry-master-keys - 3D reproduction of TSA Master key 2017-05-12
python3-cookbook - "The Python Cookbook" 3 rd Edition Translatio 2017-05-12
isso - a Disqus alternative https:... 2017-05-12
hologram - A markdown based documentation system for style gu... 2017-05-12
www.html5rocks.com - ....a top-notch resource for web developer 2017-05-12
MTStatusBarOverlay - A custom iOS status bar overlay seen in Apps like ... 2017-05-12
blueprint - Reverse engineer server configuration ... 2017-05-12
PullToRefresh - A simple iPhone TableViewController for adding the... 2017-05-12
mrjob - Run MapReduce jobs on Hadoop or Amazon Web Service... 2017-05-11

 Back to top