123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835 |
- <!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;"> </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>
|