wuhongyuq 5 years ago
parent
commit
ffae0e5a82

BIN
free-technological-management/WebRoot/mapApply/down.png


+ 83 - 0
free-technological-management/WebRoot/mapApply/getCoordinate.html

@@ -0,0 +1,83 @@
+<!DOCTYPE html">
+<html>
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+	<title>选择位置</title>
+	
+	<style type="text/css">
+		body, html {width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
+		p{margin-left:5px; font-size:14px;}
+	</style>
+	<link rel="stylesheet" href="${contextPath}/css/bootstrap/bootstrap.min.css">
+	
+</head>
+<body >
+	<div style="width: 100%; height: 100%; position:fixed; margin: 0px; padding: 0px; " >
+	
+	  <div id="allmap" style="width: 100%; height: 100%; position:fixed; margin: 0px; padding: 0px; "></div>
+	  
+	  <div class="" style="position: absolute; top: 20px; left: 20px; background-color: white; " >
+	  <button id="okButton" onclick="getCoordinate();" disabled="disabled">确定选择</button>
+	  </div>
+	  
+	</div>
+	<script src="${contextPath}/js/jquery.min.js" type="text/javascript"></script>
+	<script src="${contextPath}/js/bootstrap.min.js" type="text/javascript"></script>
+	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hBMSWzhG6vGdgnwa2Y6LwkFXjkGu0lpr"></script>
+	<script type="text/javascript">
+		var lng = 0;
+		var lat = 0;
+		// 百度地图API功能
+		var map = new BMap.Map("allmap", {enableMapClick:false});// 创建Map实例
+		var point = new BMap.Point(125.296419,43.833421);
+		map.setMapStyle({style:'googlelite'});
+		map.centerAndZoom(point,13);
+		
+		function myFun(result){
+			var cityName = result.name;
+			map.setCenter(cityName);
+		}
+		
+		var myCity = new BMap.LocalCity();
+		myCity.get(myFun);
+		
+		map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
+		
+		/*
+		var geolocation = new BMap.Geolocation();
+		geolocation.getCurrentPosition(function(r){
+			if(this.getStatus() == BMAP_STATUS_SUCCESS){
+				map.clearOverlays(); 
+				var mk = new BMap.Marker(r.point);
+				map.addOverlay(mk);
+				map.panTo(r.point);
+				lng = r.point.lng;
+				lat = r.point.lat;
+				$('#okButton').attr('disabled',false);
+			}
+			else {
+				alert('failed'+this.getStatus());
+			}        
+		},{enableHighAccuracy: true})
+		*/
+		
+		//单击获取点击的经纬度
+		map.addEventListener("click",function(e){
+			lng = e.point.lng;
+			lat = e.point.lat;
+			map.clearOverlays(); 
+			var marker = new BMap.Marker(e.point); // 创建点
+			map.addOverlay(marker);            //增加点
+			$('#okButton').attr('disabled',false);
+		});
+		
+		function getCoordinate(){
+			if(confirm("您确定选择当前坐标么?")){
+				window.opener.setCoordinate(lng, lat);
+				window.close();
+			}
+		}
+	</script>
+</body>
+</html>

+ 835 - 0
free-technological-management/WebRoot/mapApply/map.html

@@ -0,0 +1,835 @@
+<!DOCTYPE html">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+<title>吉林省产业技术创新联盟管理平台-联盟地图</title>
+<style type="text/css">
+::-webkit-scrollbar {
+	width: 8px;
+	height: 5px;
+}
+
+::-webkit-scrollbar-track {
+	-webkit-box-shadow: inset 0 0 6px rgba(198, 196, 231, 0.9);
+	border-radius: 10px;
+}
+
+::-webkit-scrollbar-thumb {
+	border-radius: 10px;
+	background: rgba(79, 148, 251, 0.4); ::
+	-webkit-box-shadow: inset 0 0 6px rgba(79, 148, 251, 0.9);
+}
+
+::-webkit-scrollbar-thumb:window-inactive {
+	background: rgba(79, 148, 251, 0.9);
+}
+
+body, html {
+	width: 100%;
+	height: 100%;
+	margin: 0;
+	font-family: "微软雅黑";
+}
+
+p {
+	margin-left: 5px;
+	font-size: 14px;
+}
+
+* {
+	list-style: none;
+	padding: 0;
+	margin: 0;
+	text-decoration: none;
+}
+
+li {
+	padding: 5px 0 0 15px;
+	font-size: 16px;
+}
+
+li a {
+	color: #151515;
+}
+
+li a:hover {
+	color: #3385ff;
+}
+
+#txt {
+	width: 199px;
+	font-family: "Microsoft Yahei", "微软雅黑", Tahoma, Arial, Helvetica,
+		STHeiti;
+	height: 26px;
+	line-height: 26px;
+	border: none;
+	outline: none;
+	margin: 6px 0 0 15px;
+	font-size: 16px;
+	float: left;
+}
+
+#go {
+	position: relative;
+	width: 39px;
+	height: 27px;
+	border-left: 1px solid #ccc;
+	margin-top: 6px;
+}
+
+#go #go_box {
+	display: none;
+	position: absolute;
+	left: -2px;
+	top: 25px;
+	z-index: 3;
+	width: 40px;
+	height: 32px;
+	line-height: 37px;
+	text-align: center;
+	background: url(${contextPath}/img/tishi.gif) no-repeat;
+	font-size: 12px;
+	color: white;
+}
+
+#go #goto_box {
+	display: none;
+	position: absolute;
+	left: -330px;
+	top: -5px;
+	z-index: 5;
+	width: 368px;
+	height: 320px;
+	line-height: 37px;
+	text-align: center;
+	background: white;
+	font-size: 12px;
+	color: white;
+}
+
+#da {
+	position: relative;
+	width: 54px;
+	height: 38px;
+	background: #3385ff;
+}
+
+#da:hover {
+	background: #1d6ee7;
+}
+
+#da #da_box {
+	display: none;
+	position: absolute;
+	left: 10px;
+	top: 31px;
+	z-index: 2;
+	width: 40px;
+	height: 32px;
+	line-height: 37px;
+	text-align: center;
+	background: url(${contextPath}/img/tishi.gif) no-repeat;
+	font-size: 12px;
+	color: white;
+}
+
+.map1 {
+	padding: 5px 0 0 12px;
+}
+
+.jing1 {
+	padding: 10px 0 0 20px;
+}
+
+#map {
+	position: relative;
+	width: 385px;
+	height: 38px;
+	border: 1px solid #f3f1ee;
+	background: white;
+}
+/*  display:block; position:absolute; left:-1px; top:39px; z-index:1;  */
+#map #map_box {
+	position: absolute;
+	left: -1px;
+	top: 39px;
+	z-index: 1; /*  background:rgba(243,232,213,0.8); */
+}
+
+.BMap_bubble_content {
+	color: #17b0e3 !important;
+	font-size: 16px !important;
+	font-family: "Microsoft Yahei", "微软雅黑", Tahoma, Arial, Helvetica,
+		STHeiti;
+}
+
+.BMapLib_nav_tab li {
+	font-size: 12px;
+}
+
+tbody {
+	font-size: 12px;
+}
+/*新下拉*/
+*, *::after, *::before {
+	margin: 0;
+	padding: 0;
+	box-sizing: border-box;
+}
+
+body {
+	height: 100vh;
+	font-family: "Open Sans", sans serif;
+	-webkit-font-smoothing: antialiased;
+	-moz-osx-font-smoothing: grayscale;
+}
+
+.title {
+	color: #fff;
+	text-transform: uppercase;
+	text-align: center;
+	padding-bottom: 20px;
+}
+
+.contenedor-acordeon {
+	width: 210px;
+	overflow: hidden;
+}
+
+.acordeon {
+	width: 100%;
+	overflow: hidden;
+	border-top: 1px solid #fff;
+}
+
+.acordeon__head {
+	background: #3889D4;
+	display: flex;
+	justify-content: space-between;
+	align-items: center;
+	padding: 10px 25px 10px 10px;
+}
+
+.acordeon__head:hover {
+	cursor: pointer;
+}
+
+.acordeon__head--logo {
+	width: 8%;
+}
+
+.acordeon__head--title {
+	display: inline-block;
+	text-transform: uppercase;
+	font-size: 15px;
+	color: #fff;
+}
+
+.acordeon__body {
+	height: 0;
+	transition: height .4s ease-in-out;
+	box-shadow: 0 0 6px rgba(0, 0, 0, 0.2) inset;
+}
+
+.acordeon__body__menu {
+	list-style: none;
+	background: #fff;
+}
+
+.acordeon__body__menu li {
+	padding: 10px 0 10px 15px;
+}
+
+.acordeon__body__menu li:hover {
+	background: rgb(188, 215, 254);
+}
+
+.acordeon__body__menu li a {
+	display: block;
+	color: #000;
+	text-decoration: none;
+	font-size: 12px;
+	line-height: 10px;
+}
+
+.active {
+	height: 56px;
+}
+
+#result li {
+	font-size: 12px;
+}
+
+#result li div span {
+	font-family: "微软雅黑";
+	color: #000000 !important;
+}
+
+#result li div div>b {
+	display: none;
+}
+/*坐标点的信息框*/
+.BMap_bubble_content {
+	color: #000000 !important;
+	font-size: 14px !important;
+	font-family: "Microsoft Yahei", "微软雅黑", Tahoma, Arial, Helvetica,
+		STHeiti;
+}
+</style>
+<link rel="stylesheet" href="${contextPath}/mapApply/nav.css">
+<link rel="stylesheet"
+	href="${contextPath}/css/bootstrap/bootstrap.min.css">
+<script type="text/javascript">
+    function daO(){
+        var da_box=document.getElementById("da_box");
+        da_box.style.display="block";
+        }        
+    function daT(){
+        var da_box=document.getElementById("da_box");
+        da_box.style.display="none";
+        }        
+    </script>
+</head>
+<body>
+	<div
+		style="width: 100%; height: 100%; position: fixed; margin: 0px; padding: 0px;">
+
+		<div id="allmap"
+			style="width: 100%; height: 100%; position: fixed; margin: 0px; padding: 0px;"></div>
+
+		<div class=""
+			style="position: absolute; top: 20px; left: 20px; margin: 0px;">
+			<div style="position: fixed; right: 0; width: 400px;">
+				<div style="float: right;">
+					<input placeholder="请输入要查询的地点" id="searchInput"
+						style="float: left; border: none; width: 345px; height: 37.5px;" />
+					<div id="da" style="float: left; margin-bottom: 8%;"
+						onmouseover="daO()" onmouseout="daT()" onclick="toSearch()">
+						<img src="${contextPath}/img/jing.gif" alt="" class="jing1" />
+						<div id="da_box">搜索</div>
+					</div>
+				</div>
+				<div id="result"
+					style="float: left; width: 90%; height: 85vh; overflow-y: auto;">
+					<div id="resultContext"></div>
+					<div id="pagination" class="pagination" style="position: absolute;"></div>
+					<!-- <nav aria-label="Page navigation">
+				  <ul class="pagination" id="navList"></ul>
+				</nav> -->
+				</div>
+			</div>
+			<input id="Dtype" type="hidden" /> <input id="Xtype" type="hidden" />
+			<div class="contenedor-acordeon" id="acordeon-content">
+				<div class="acordeon">
+					<div class="acordeon__head" onclick="firstMenu(1)">
+						<p class="acordeon__head--title">政府部门</p>
+						<img src="down.png" />
+					</div>
+					<div class="acordeon__body">
+						<div class="acordeon__body__menu">
+							<li onclick="secMenu(1)"><a href="#">科技厅</a></li>
+							<li onclick="secMenu(2)"><a href="#">各地科技局</a></li>
+						</div>
+					</div>
+				</div>
+				<div class="acordeon">
+					<div class="acordeon__head" onclick="firstMenu(2)">
+						<p class="acordeon__head--title">高等院校</p>
+						<img src="down.png" />
+					</div>
+					<div class="acordeon__body">
+						<div class="acordeon__body__menu">
+							<li onclick="secMenu(1)"><a href="#">大学</a></li>
+							<li onclick="secMenu(2)"><a href="#">大专</a></li>
+							<li onclick="secMenu(3)"><a href="#">技校</a></li>
+						</div>
+					</div>
+				</div>
+				<div class="acordeon">
+					<div class="acordeon__head" onclick="firstMenu(3)">
+						<p class="acordeon__head--title">科研机构</p>
+						<img src="down.png" />
+					</div>
+					<div class="acordeon__body">
+						<div class="acordeon__body__menu">
+							<li onclick="secMenu(1)"><a href="#">科研机构(市直)</a></li>
+							<li onclick="secMenu(2)"><a href="#">科研机构(省直)</a></li>
+							<li onclick="secMenu(3)"><a href="#">科技金融机构 </a></li>
+							<li onclick="secMenu(4)"><a href="#">科技中介</a></li>
+							<li onclick="secMenu(5)"><a href="#">技术大市场 </a></li>
+						</div>
+					</div>
+				</div>
+				<div class="acordeon">
+					<div class="acordeon__head" onclick="firstMenu(4)">
+						<p class="acordeon__head--title">企业集团</p>
+						<img src="down.png" />
+					</div>
+					<div class="acordeon__body">
+						<div class="acordeon__body__menu">
+							<li onclick="secMenu(1)"><a href="#">高企</a></li>
+							<li onclick="secMenu(2)"><a href="#">科技企业 </a></li>
+						</div>
+					</div>
+				</div>
+				<div class="acordeon">
+					<div class="acordeon__head" onclick="firstMenu(5)">
+						<p class="acordeon__head--title">科技认证</p>
+						<img src="down.png" />
+					</div>
+					<div class="acordeon__body">
+						<div class="acordeon__body__menu">
+							<li onclick="secMenu(1)"><a href="#">创业中心</a></li>
+							<li onclick="secMenu(2)"><a href="#">孵化众创 </a></li>
+							<li onclick="secMenu(3)"><a href="#">院士工作站 </a></li>
+							<li onclick="secMenu(4)"><a href="#">技术合同登记点 </a></li>
+							<li onclick="secMenu(5)"><a href="#">企业技术中心 </a></li>
+							<li onclick="secMenu(6)"><a href="#">专家大院 </a></li>
+							<li onclick="secMenu(7)"><a href="#">星众空间 </a></li>
+							<li onclick="secMenu(8)"><a href="#">测试中心 </a></li>
+							<li onclick="secMenu(9)"><a href="#">产业基地</a></li>
+							<li onclick="secMenu(10)"><a href="#">创新联盟 </a></li>
+						</div>
+					</div>
+				</div>
+				<div class="acordeon">
+					<div class="acordeon__head" onclick="firstMenu(6)">
+						<p class="acordeon__head--title">重大项目</p>
+						<img src="down.png" />
+					</div>
+					<div class="acordeon__body">
+						<div class="acordeon__body__menu">
+							<li onclick="secMenu(1)"><a href="#">承接单位</a></li>
+							<li onclick="secMenu(2)"><a href="#">负责人</a></li>
+							<li onclick="secMenu(3)"><a href="#">技术成果/在研</a></li>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+	<script src="${contextPath}/mapApply/nav.js" type="text/javascript"></script>
+	<script src="${contextPath}/js/jquery.min.js" type="text/javascript"></script>
+	<script src="${contextPath}/js/bootstrap.min.js" type="text/javascript"></script>
+	<script type="text/javascript"
+		src="http://api.map.baidu.com/api?v=2.0&ak=hBMSWzhG6vGdgnwa2Y6LwkFXjkGu0lpr"></script>
+	<script type="text/javascript"
+		src="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script>
+	<link rel="stylesheet"
+		href="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.css" />
+	<script type="text/javascript">
+	function firstMenu (type){
+		$("#Dtype").val(type)
+		$("#Xtype").val('');
+		var menuBody = document.querySelectorAll(".acordeon__body");
+		for(var i=0;i<menuBody.length;i++) {
+			menuBody[i].style.height = 0;
+		}
+		var thisMenuBody = menuBody[type-1];
+		var menu = thisMenuBody.firstElementChild;
+		if(thisMenuBody.clientHeight){
+			thisMenuBody.style.height = 0;
+	   	}else{
+	     	var altoMenu = menu.clientHeight;
+	     	thisMenuBody.style.height = altoMenu + "px";
+		}
+	 }
+	function secMenu(type) {
+		$("#Xtype").val(type);
+		toSearch('not clean');
+	}
+		 //监控侧菜单
+		/* var acordeon = document.getElementById("acordeon-content"),
+	    acordeonBody = [...document.querySelectorAll(".acordeon__body")];
+	
+		function openMenu(element){
+		  	 var parent  = element.target.parentNode,
+		 	 lastChild = parent.lastElementChild,
+		 	 menu = lastChild.firstElementChild;
+		  	 console.log(element);
+		  	 console.log(lastChild)
+		  	 console.log(menu)
+		    
+			acordeonBody.map(el => el.style.height = 0);   
+		  if(lastChild.clientHeight){
+		        lastChild.style.height = 0;
+		   	}else{
+		     	var altoMenu = menu.clientHeight;
+		        lastChild.style.height = altoMenu + "px";
+			}
+		}
+		function getTarget(e){  
+		  	if(e.target.tagName === "DIV"){
+		     	 openMenu(e); 
+		  	} 
+		}
+		acordeon.addEventListener("click", getTarget);
+		
+		//侧菜单事件绑定
+		menuEvent()
+		function menuEvent(){
+		 	var Dtype = $(".acordeon__head");
+			var Xtype = $(".acordeon__body__menu") 
+			var _this =this;
+			var Dtype = document.querySelectorAll('.acordeon__head');
+			var Xtype = document.querySelectorAll('.acordeon__body__menu li');
+			for(var i=0; i<Dtype.length;i++){
+				$(Dtype[i]).on("click",{Dtype:i+1},function(e){
+					$("#Dtype").val(e.handleObj.data.Dtype)
+					$("#Xtype").val('');
+					toSearch('not clean');
+				})
+			}
+			for(var i=0; i<Xtype.length;i++){
+				$(Xtype[i]).on("click",{Xtype:i+1},function(e){
+					$("#Xtype").val(e.handleObj.data.Xtype)
+					toSearch('not clean');
+				})
+			}
+		} */
+	
+	
+		// 百度地图API功能
+		var map = new BMap.Map("allmap", {enableMapClick:false});// 创建Map实例
+		var point = new BMap.Point(125.296419,43.833421);
+		map.setMapStyle({style:'googlelite'});
+		map.centerAndZoom(point,12);
+		
+	
+		
+		//map.setCurrentCity("长春");          // 设置地图显示的城市 此项是必须设置的
+		
+		/* var navigationControl = new BMap.NavigationControl({
+		    // 靠左上角位置
+		    anchor: BMAP_ANCHOR_TOP_RIGHT,
+		    // LARGE类型
+		    type: BMAP_NAVIGATION_CONTROL_LARGE,
+		    // 启用显示定位
+		    enableGeolocation: true
+		  });
+		 map.addControl(navigationControl); */
+		
+		 // 添加定位控件
+		  var geolocationControl = new BMap.GeolocationControl();
+		  geolocationControl.addEventListener("locationSuccess", function(e){
+		    // 定位成功事件
+		    var address = '';
+		    address += e.addressComponent.province;
+		    address += e.addressComponent.city;
+		    address += e.addressComponent.district;
+		    address += e.addressComponent.street;
+		    address += e.addressComponent.streetNumber;
+		    alert("当前定位地址为:" + address);
+		  });
+		  geolocationControl.addEventListener("locationError",function(e){
+		    // 定位失败事件
+		    alert(e.message);
+		  });
+		  map.addControl(geolocationControl);
+		
+		
+		  
+		  
+		  
+		  
+		  
+		  
+		function myFun(result){
+			var cityName = result.name;
+			map.setCenter(cityName);
+		}
+		
+		var myCity = new BMap.LocalCity();
+		myCity.get(myFun);
+		
+		map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
+		
+		/*
+		var geolocation = new BMap.Geolocation();
+		geolocation.getCurrentPosition(function(r){
+			if(this.getStatus() == BMAP_STATUS_SUCCESS){
+				var mk = new BMap.Marker(r.point);
+				map.addOverlay(mk);
+				map.panTo(r.point);
+				alert('您的位置:\n'+r.point.lng+',\n'+r.point.lat);
+			}
+			else {
+				alert('failed\n'+this.getStatus());
+			}        
+		},{enableHighAccuracy: true})
+		*/
+		
+		
+		function getOrganizationByCode(infotype){
+			$.ajax({ 
+				url: "${contextPath}/mapApply/getOrganizationByCode",
+				dataType: 'json',
+				data: {
+					code:infotype
+				},
+				type: 'post',
+				success: function(data){
+					// alert(data.code);
+					map.clearOverlays(); 
+					if(data.length > 0){
+						map.centerAndZoom(new BMap.Point(data[0].longitude, data[0].latitude),12);
+						for(i=0; i < data.length; i++){
+							var marker = new BMap.Marker(new BMap.Point(data[i].longitude, data[i].latitude));  // 创建标注
+							map.addOverlay(marker);               // 将标注添加到地图中
+							addClickHandler(data[i], marker);
+						}
+					}
+				}
+			});
+		} 
+		/* 下边我注释掉  */
+		/* function getOrganizationByAlliance(infotype){
+			$.ajax({ 
+				url: "${contextPath}/mapApply/getOrganizationByAlliance",
+				dataType: 'json',
+				data: {
+					code:infotype
+				},
+				type: 'post',
+				success: function(data){
+					// alert(data.code);
+					map.clearOverlays(); 
+					if(data.length > 0){
+						map.centerAndZoom(new BMap.Point(data[0].longitude, data[0].latitude),12);
+						for(i=0; i < data.length; i++){
+							var marker = new BMap.Marker(new BMap.Point(data[i].longitude, data[i].latitude));  // 创建标注
+							map.addOverlay(marker);               // 将标注添加到地图中
+							addClickHandler(data[i].mapInfo, marker);
+						}
+					}
+				}
+			});
+		} */
+		
+		function addClickHandler(data,marker){
+			
+			var searchInfoWindow = null;
+			searchInfoWindow = new BMapLib.SearchInfoWindow(map, data.mapInfo, {
+			
+			title  : data.name,      //标题
+			width  : 290,             //宽度
+			height : 105,              //高度
+			panel  : "panel",         //检索结果面板
+			enableAutoPan : true,     //自动平移
+			searchTypes   :[
+				BMAPLIB_TAB_SEARCH,   //周边检索
+				BMAPLIB_TAB_TO_HERE,  //到这里去
+				BMAPLIB_TAB_FROM_HERE //从这里出发
+			]
+			});
+			
+			marker.enableDragging(); //marker可拖拽
+			marker.addEventListener("click", function(e){
+			searchInfoWindow.open(marker);
+			})
+			map.addOverlay(marker);
+		}
+
+	  
+		/*var content = '<div style="margin:0;line-height:20px;padding:2px;">' +
+        '<img src="../img/baidu.jpg" alt="" style="float:right;zoom:1;overflow:hidden;width:100px;height:100px;margin-left:3px;"/>' +
+        '地址:长春市朝阳区前进大街与繁荣路交汇<br/>电话:(010)59928888<br/>简介:科技厅简介科技厅简介' +
+      '</div>';*/
+
+		//创建检索信息窗口对象
+		 //在地图中添加marker
+		
+		
+		/* var opts = {
+					enableMessage:true//设置允许信息窗发送短息
+					
+				   }; */
+		
+		
+		/* function openInfo(content,e){
+			var p = e.target;
+			var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
+			var infoWindow = new BMap.InfoWindow(content,opts);  // 创建信息窗口对象 
+// 			map.openInfoWindow(infoWindow,point); //开启信息窗口
+		}
+		
+		showAlliance();
+		<%if(""!=msg!""){%>
+		alert('${msg}');
+		<%}%> */
+		//坐标点
+		var points = [
+			/* {point:new BMap.Point(125.297027,43.847097),title:"力旺广场",description: '这里是力旺广场',address:'力旺'},
+			{point:new BMap.Point(125.302855,43.873426),title:"万达广场",description: '这里是万达广场',address:'万达'}, */
+			];
+		var infoList = [];
+		function turnPoint(points){
+			//添加gps marker和label
+		    var changePoint = new BMap.Marker(points.point);
+			//添加info框
+			var info = new BMap.InfoWindow(points.description);
+			changePoint.addEventListener("click", function() {
+				// 调用了marker对象的openInfoWindow方法
+				this.openInfoWindow(info); 
+			});
+			infoList.push(changePoint);
+		    map.addOverlay(changePoint); //添加GPS marker
+		    var changeLabel = new BMap.Label(points.title,{offset:new BMap.Size(20,0)});
+		    changeLabel.setStyle({
+		    	display: "inline-table"
+		    });
+		    changePoint.setLabel(changeLabel); //添加GPS label
+		}
+	    
+
+	    setTimeout(function(){
+	    	if(points.length>0){
+	    		var convertor = new BMap.Convertor();
+		        for(var i=0;i<points.length;i++){
+		        	turnPoint(points[i]);
+		        }
+	    	}
+	    }, 1000);
+	    //查询
+	    $("#searchInput").keydown(function(e){
+	    	if (e.keyCode == 13) {  
+               toSearch();
+         }  
+	    })
+	    
+	     var limit = 13;
+	    function toSearch(info){
+	    	if(!info){
+	    		$("#Dtype").val('');
+	    		$("#Xtype").val('');
+	    	}
+	    	var info = $("#searchInput").val();
+	    	var result = search();
+	    	var totalRow = result.totalRow;
+	    	if(totalRow > 0) {
+	    		new myPagination({
+			        id: 'pagination',
+			        curPage:1, //初始页码
+			        pageTotal: Math.ceil(totalRow/limit), //总页数
+					pageAmount: limit,  //每页多少条
+			        dataTotal: totalRow, //总共多少条数据
+					pageSize: 5, //可选,分页个数
+			        showPageTotalFlag:false, //是否显示数据统计
+			        showSkipInputFlag:false, //是否支持跳转
+			        getPage: function (page) {
+			            //获取当前页数
+			            console.log(page);
+			            //请求下一页数据,进行替换
+			            search(page);
+			        }
+			    })
+	    	} else {
+	    		$("#pagination").html('');
+	    	}
+	    	
+	    }
+	    
+	    function search(page){
+	    	var _this = this;
+	    	var totalRow = 0;
+	    	var Dtype=$("#Dtype").val()|| '',
+	    		Xtype=$("#Xtype").val()|| '';
+	    	$.ajax({
+	    		url: '${contextPath}/admin/enterprise/getMapEnterpriseList',
+	    		data:{
+	    			name:$("#searchInput").val() || '',
+	    			code: '',
+	    			pageNumber: page || 1,
+	    			Dtype: Dtype,
+	    			Xtype: Xtype,
+	    		},
+	    		async: false,
+	    		cache: false,
+	    		dataType: "json",
+	    		success: function(data) {
+	    			if(data.dateList && data.dateList.length > 0) {
+	    				totalRow=data.totalPage;
+	    				points = [];
+	    				if(data.dateList.length > 0){
+	    					for(var i = 0; i < data.dateList.length; i++){
+		    					if(!data.dateList[i].longitude){
+		    						continue;
+		    					}
+		    					_this.points.push({
+		    						point: new BMap.Point(data.dateList[i].longitude,data.dateList[i].latitude),
+		    						title: data.dateList[i].name || 'no title',
+		    						address: data.dateList[i].addr || 'no address',
+		    						description: data.dateList[i].introduction || 'no description'
+		    					})
+	    					}
+		    				$("#resultContext").html(_this.resultList(points));
+		    				_this.map.clearOverlays();
+		    				var convertor = new BMap.Convertor();
+	    			        for(var i=0;i<_this.points.length;i++){
+	    			        	_this.turnPoint(_this.points[i]);
+	    			        }
+		    			}
+    				} else {
+    					$("#resultContext").html('<div style="background: #cf8312;">没有搜索到信息</div>');
+    					_this.map.clearOverlays();
+    				}
+	    				
+	    		},
+	    		error:function(error){
+	    			console.log(error)
+	    		}
+	    	});
+	    	return {totalRow:totalRow}
+	    }
+	    
+	    function resultList(data){
+	    	var html = '<div style="font: 12px arial, sans-serif;">\n'+
+						'<div style="background: rgb(255, 255, 255);">\n'+
+							'<ol style="list-style: none; padding: 0px; margin: 0px;">' +'<br/>';
+								for(var i=0;i<data.length;i++) {
+									html+=returnLi(data[i],i);
+								}
+				html += 	'</ol>\n'+
+						'</div>\n'+
+						'<div style="white-space: nowrap; text-align: right; background: rgb(229, 236, 249); margin-top: 5px; padding: 2px; overflow: hidden; zoom: 1;">\n'+
+							'<div style="float: left; margin-right: 5px;">\n'+
+								'<p style="margin:0;padding:0;white-space:nowrap">\n'+
+								'</p>\n'+
+								'</div>\n'+
+						'</div>\n'+'<br/>';
+			return html;
+	    }
+	    function returnLi(data,index){
+	    	var url = data.detailUrl ? data.detailUrl : "#",
+		    		title = data.title ? data.title : 'none',
+		    		address = data.address ? data.address : 'none';
+		    	var li = '<li onclick="toOpenInfo('+index+')" style="margin: 10px 0px; padding: 0px 5px 5px 0px; cursor: pointer; overflow: hidden; line-height: 17px;">\n'+
+		    				'<span style="background:url(http://api.map.baidu.com/images/markers.png) -23px -275px no-repeat;width:19px;height:25px;cursor:pointer;float:left;*zoom:1;overflow:hidden;margin:2px 3px 0 5px;*margin-right:0px;display:inline;">&nbsp;</span>\n'+
+		    				'<div style="zoom: 1; overflow: hidden; padding: 0px 5px;">\n'+
+		    					'<div style="line-height:20px;font-size:12px;">'+
+		    						'<a target="_blank" href="'+url+'" style="margin-left:5px;font-size:12px;color:#3d6dcc;font-weight:normal;text-decoration:none;">\n '+title+'</a>\n'+
+		    					'</div>\n'+
+			    				'<div style="padding:2px 0;line-height:18px;*zoom:1;overflow:hidden;">\n'+
+			    					'<span style="float:left;*zoom:1;overflow:hidden;padding-right:5px;*margin-right:-3px;">地址:</span>\n'+
+			    					'<span style="color:#000000;display:block;zoom:1;overflow:hidden;">\n '+address+'</span>\n'+
+			    				'</div>\n';
+			    				if(data.phoneNumber){
+			    					li+='<div style="padding:2px 0;line-height:18px;*zoom:1;overflow:hidden;">\n'+
+					    					'<span style="float:left;font-weight:bold;*zoom:1;overflow:hidden;padding-right:5px;*margin-right:-3px;">电话:</span>\n'+
+					    					'<span style="color:#000000;">\n'+data.phoneNumber+'</span>\n'+
+					    				'</div>\n';
+			    				}
+			    				
+	    				li+='</div>\n'+
+			    		 '</li>';
+	    		 return li;
+	    }
+	    function toOpenInfo(index){
+			//添加info框
+			var info = new BMap.InfoWindow(points[index].description);
+	    	map.openInfoWindow(info,points[index].point);
+	    }
+	</script>
+</body>
+</html>

+ 88 - 0
free-technological-management/WebRoot/mapApply/nav.css

@@ -0,0 +1,88 @@
+.pagination ul {
+    list-style: none;
+    padding-left: 0;
+}
+
+.pagination ul li {
+    padding: 0 10px;
+    vertical-align: top;
+    display: inline-block;
+    font-size: 14px;
+    min-width: 36px;
+    min-height: 28px;
+    line-height: 28px;
+    cursor: pointer;
+    box-sizing: border-box;
+    text-align: center;
+    background-color: #ffffff;
+    color: #606266;
+    border-radius: 6px;
+    margin: 0 1px;
+    border: 1px solid #ebebeb;
+    height: 30px;
+}
+
+.pagination ul li:hover {
+    transform: scale(1.1);
+    background-color: #F4F6F8;
+}
+
+.pagination  li.active {
+    background: #98A6AD;
+    color: white;
+    cursor: not-allowed;
+}
+
+.pagination li.disabled {
+    cursor: not-allowed;
+}
+.pagination li.totalPage {
+    background: transparent;
+    cursor: default;
+    border: none;
+    padding: 0 6px;
+}
+
+.pagination li.totalPage:hover {
+    transform: none;
+    background-color: #ffffff;
+}
+
+
+.pagination li input {
+    -webkit-appearance: none;
+    background-color: #fff;
+    background-image: none;
+    border-radius: 4px;
+    border: 1px solid #dcdfe6;
+    box-sizing: border-box;
+    color: #606266;
+    display: inline-block;
+    font-size: inherit;
+    outline: none;
+    padding: 3px 5px;
+    transition: border-color .2s cubic-bezier(.645,.045,.355,1);
+    width: 40px;
+    height: 25px;
+    margin: 0 6px;
+}
+
+.pagination li input:focus{
+    border-color: #98A6AD;
+}
+.pagination{
+    user-select: none;
+}
+
+.pagination ul:nth-child(2){
+    border-radius: 6px;
+}
+
+input[type=number] {
+    -moz-appearance:textfield;
+}
+input[type=number]::-webkit-inner-spin-button,
+input[type=number]::-webkit-outer-spin-button {
+    -webkit-appearance: none;
+    margin: 0;
+}

+ 200 - 0
free-technological-management/WebRoot/mapApply/nav.js

@@ -0,0 +1,200 @@
+function myPagination(_ref) {
+    var pageSize = _ref.pageSize,
+        pageTotal = _ref.pageTotal,
+        curPage = _ref.curPage,
+        id = _ref.id,
+        getPage = _ref.getPage,
+        showPageTotalFlag = _ref.showPageTotalFlag,
+        showSkipInputFlag = _ref.showSkipInputFlag,
+        pageAmount = _ref.pageAmount,
+        dataTotal = _ref.dataTotal;
+
+    this.pageSize = pageSize || 3; //分页个数
+    this.pageTotal = pageTotal || 0; //总共多少页
+    this.pageAmount = pageAmount || 13; //每页多少条
+    this.dataTotal = dataTotal || 0; //总共多少数据
+    this.curPage = curPage || 1; //初始页码
+    this.ul = document.createElement('ul');
+    this.id = id;
+    this.getPage = getPage;
+    this.showPageTotalFlag = showPageTotalFlag || false; //是否显示数据统计
+    this.showSkipInputFlag = showSkipInputFlag || false; //是否支持跳转
+    this.init();
+};
+
+// 给实例对象添加公共属性和方法
+myPagination.prototype = {
+    init: function init() {
+        var pagination = document.getElementById(this.id);
+        pagination.innerHTML = '';
+        this.ul.innerHTML = '';
+        pagination.appendChild(this.ul);
+        var that = this;
+        //首页
+        that.firstPage();
+        //上一页
+        that.lastPage();
+        //分页
+        that.getPages().forEach(function (item) {
+            var li = document.createElement('li');
+            if (item == that.curPage) {
+                li.className = 'active';
+            } else {
+                li.onclick = function () {
+                    that.curPage = parseInt(this.innerHTML);
+                    that.init();
+                    that.getPage(that.curPage);
+                };
+            }
+            li.innerHTML = item;
+            that.ul.appendChild(li);
+        });
+        //下一页
+        that.nextPage();
+        //尾页
+        that.finalPage();
+
+        //是否支持跳转
+        if (that.showSkipInputFlag) {
+            that.showSkipInput();
+        }
+        //是否显示总页数,每页个数,数据
+        if (that.showPageTotalFlag) {
+            that.showPageTotal();
+        }
+    },
+    //首页
+    firstPage: function firstPage() {
+        var that = this;
+        var li = document.createElement('li');
+        li.innerHTML = '首页';
+        this.ul.appendChild(li);
+        li.onclick = function () {
+            var val = parseInt(1);
+            that.curPage = val;
+            that.getPage(that.curPage);
+            that.init();
+        };
+    },
+    //上一页
+    lastPage: function lastPage() {
+        var that = this;
+        var li = document.createElement('li');
+        li.innerHTML = '<';
+        if (parseInt(that.curPage) > 1) {
+            li.onclick = function () {
+                that.curPage = parseInt(that.curPage) - 1;
+                that.init();
+                that.getPage(that.curPage);
+            };
+        } else {
+            li.className = 'disabled';
+        }
+        this.ul.appendChild(li);
+    },
+    //分页
+    getPages: function getPages() {
+        var pag = [];
+        if (this.curPage <= this.pageTotal) {
+            if (this.curPage < this.pageSize) {
+                //当前页数小于显示条数
+                var i = Math.min(this.pageSize, this.pageTotal);
+                while (i) {
+                    pag.unshift(i--);
+                }
+            } else {
+                //当前页数大于显示条数
+                var middle = this.curPage - Math.floor(this.pageSize / 2),
+                    //从哪里开始
+                    i = this.pageSize;
+                if (middle > this.pageTotal - this.pageSize) {
+                    middle = this.pageTotal - this.pageSize + 1;
+                }
+                while (i--) {
+                    pag.push(middle++);
+                }
+            }
+        } else {
+            console.error('当前页数不能大于总页数');
+        }
+        if (!this.pageSize) {
+            console.error('显示页数不能为空或者0');
+        }
+        return pag;
+    },
+    //下一页
+    nextPage: function nextPage() {
+        var that = this;
+        var li = document.createElement('li');
+        li.innerHTML = '>';
+        if (parseInt(that.curPage) < parseInt(that.pageTotal)) {
+            li.onclick = function () {
+                that.curPage = parseInt(that.curPage) + 1;
+                that.init();
+                that.getPage(that.curPage);
+            };
+        } else {
+            li.className = 'disabled';
+        }
+        this.ul.appendChild(li);
+    },
+    //尾页
+    finalPage: function finalPage() {
+        var that = this;
+        var li = document.createElement('li');
+        li.innerHTML = '尾页';
+        this.ul.appendChild(li);
+        li.onclick = function () {
+            var yyfinalPage = that.pageTotal;
+            var val = parseInt(yyfinalPage);
+            that.curPage = val;
+            that.getPage(that.curPage);
+            that.init();
+        };
+    },
+    //是否支持跳转
+    showSkipInput: function showSkipInput() {
+        var that = this;
+        var li = document.createElement('li');
+        li.className = 'totalPage';
+        var span1 = document.createElement('span');
+        span1.innerHTML = '跳转到';
+        li.appendChild(span1);
+        var input = document.createElement('input');
+        input.setAttribute("type","number");
+        input.onkeydown = function (e) {
+            var oEvent = e || event;
+            if (oEvent.keyCode == '13') {
+                var val = parseInt(oEvent.target.value);
+                if (typeof val === 'number' && val <= that.pageTotal) {
+                    that.curPage = val;
+                    that.getPage(that.curPage);
+                }else{
+                    alert("跳转页数不能大于总页数 !")
+                }
+                that.init();
+            }
+        };
+        li.appendChild(input);
+        var span2 = document.createElement('span');
+        span2.innerHTML = '页';
+        li.appendChild(span2);
+        this.ul.appendChild(li);
+    },
+    //是否显示总页数,每页个数,数据
+    showPageTotal: function showPageTotal() {
+        var that = this;
+        var li = document.createElement('li');
+        li.innerHTML = '共&nbsp' + that.pageTotal + '&nbsp页';
+        li.className = 'totalPage';
+        this.ul.appendChild(li);
+        var li2 = document.createElement('li');
+        li2.innerHTML = '每页&nbsp' + that.pageAmount + '&nbsp条';
+        li2.className = 'totalPage';
+        this.ul.appendChild(li2);
+        var li3 = document.createElement('li');
+        li3.innerHTML = '合计&nbsp' + that.dataTotal + '&nbsp条数据';
+        li3.className = 'totalPage';
+        this.ul.appendChild(li3);
+    }
+};