|
@@ -0,0 +1,310 @@
|
|
|
+// var PATH = "http://data.cqna.gov.cn";
|
|
|
+// var PATH = "http://localhost:7777";
|
|
|
+var PATH = "";
|
|
|
+$(function(){
|
|
|
+ // 百度地图API功能
|
|
|
+ function G(id) {
|
|
|
+ return document.getElementById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ var map = new BMap.Map('right_map'); // 创建Map实例
|
|
|
+ map.centerAndZoom(new BMap.Point(106.563, 29.523), 18); // 初始化地图,设置中心点坐标和地图级别
|
|
|
+ map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
|
|
|
+ // 接收数据的数组
|
|
|
+ var allArr=[];
|
|
|
+ var getoldpoint,lngAndlat;
|
|
|
+ // 区级部门与街镇解析地址批量解析开始
|
|
|
+ var myGeo = new BMap.Geocoder();
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: PATH + '/mapdata/getMapDataAll',
|
|
|
+ // url: "http://192.168.1.253:7777/mapdata/getMapDataAll",
|
|
|
+ async: false,
|
|
|
+ success: function(res) {
|
|
|
+ $.each(res.data.xxs,function(i){
|
|
|
+ allArr.push(res.data.xxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.dxs,function(i){
|
|
|
+ allArr.push(res.data.dxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.zyyxs,function(i){
|
|
|
+ allArr.push(res.data.zyyxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.yeys,function(i){
|
|
|
+ allArr.push(res.data.yeys[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bmfwzxs,function(i){
|
|
|
+ allArr.push(res.data.bmfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ggfwzxs,function(i){
|
|
|
+ allArr.push(res.data.ggfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.dqfwzxs,function(i){
|
|
|
+ allArr.push(res.data.dqfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bms,function(i){
|
|
|
+ allArr.push(res.data.bms[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jzs,function(i){
|
|
|
+ allArr.push(res.data.jzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cycsbms,function(i){
|
|
|
+ allArr.push(res.data.cycsbms[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cyys,function(i){
|
|
|
+ allArr.push(res.data.cyys[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.byfwjgs,function(i){
|
|
|
+ allArr.push(res.data.byfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cwsss,function(i){
|
|
|
+ allArr.push(res.data.cwsss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.sqwsfwzs,function(i){
|
|
|
+ allArr.push(res.data.sqwsfwzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ekzlfwjgs,function(i){
|
|
|
+ allArr.push(res.data.ekzlfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.kqbpsfczmzs,function(i){
|
|
|
+ allArr.push(res.data.kqbpsfczmzs[i]);
|
|
|
+ });
|
|
|
+ for (let i = 0; i < res.data.myghyfjzmzs.length; i++) {
|
|
|
+ allArr.push(res.data.myghyfjzmzs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.ejyljgs.length; i++) {
|
|
|
+ allArr.push(res.data.ejyljgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.sjyljgs.length; i++) {
|
|
|
+ allArr.push(res.data.sjyljgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.sqwsfwjgs.length; i++) {
|
|
|
+ allArr.push(res.data.sqwsfwjgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.zybzdjgs.length; i++) {
|
|
|
+ allArr.push(res.data.zybzdjgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.gys.length; i++) {
|
|
|
+ allArr.push(res.data.gys[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.tcs.length; i++) {
|
|
|
+ allArr.push(res.data.tcs[i]);
|
|
|
+ }
|
|
|
+ $.each(res.data.gcs,function(i){
|
|
|
+ allArr.push(res.data.gcs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.hydjcs,function(i){
|
|
|
+ allArr.push(res.data.hydjcs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.zcyljg,function(i){
|
|
|
+ allArr.push(res.data.zcyljg[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ckmzfwjgs,function(i){
|
|
|
+ allArr.push(res.data.ckmzfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.pcss,function(i){
|
|
|
+ allArr.push(res.data.pcss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.crjywbljgs,function(i){
|
|
|
+ allArr.push(res.data.crjywbljgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jtxljcdds,function(i){
|
|
|
+ allArr.push(res.data.jtxljcdds[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jtwfcljgs,function(i){
|
|
|
+ allArr.push(res.data.jtwfcljgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jtsgcljgs,function(i){
|
|
|
+ allArr.push(res.data.jtsgcljgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cgss,function(i){
|
|
|
+ allArr.push(res.data.cgss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jdcjccss,function(i){
|
|
|
+ allArr.push(res.data.jdcjccss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jsrtjzs,function(i){
|
|
|
+ allArr.push(res.data.jsrtjzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ylfwjgs,function(i){
|
|
|
+ allArr.push(res.data.ylfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.tsgs,function(i){
|
|
|
+ allArr.push(res.data.tsgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.whgs,function(i){
|
|
|
+ allArr.push(res.data.whgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.wgss,function(i){
|
|
|
+ allArr.push(res.data.wgss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ggtys,function(i){
|
|
|
+ allArr.push(res.data.ggtys[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jqs,function(i){
|
|
|
+ allArr.push(res.data.jqs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bdcdjzxbsdts,function(i){
|
|
|
+ allArr.push(res.data.bdcdjzxbsdts[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cjrfwzxs,function(i){
|
|
|
+ allArr.push(res.data.cjrfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.qtcjrfwzxs,function(i){
|
|
|
+ allArr.push(res.data.qtcjrfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.fwglzxs,function(i){
|
|
|
+ allArr.push(res.data.fwglzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.gzcs,function(i){
|
|
|
+ allArr.push(res.data.gzcs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.sfjdjgs,function(i){
|
|
|
+ allArr.push(res.data.sfjdjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jcfwfwss,function(i){
|
|
|
+ allArr.push(res.data.jcfwfwss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.flyzzxs,function(i){
|
|
|
+ allArr.push(res.data.flyzzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bsfwts,function(i){
|
|
|
+ allArr.push(res.data.bsfwts[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.scjdgljs,function(i){
|
|
|
+ allArr.push(res.data.scjdgljs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ybs,function(i){
|
|
|
+ allArr.push(res.data.ybs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.dkblds,function(i){
|
|
|
+ allArr.push(res.data.dkblds[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cjgshfwzs,function(i){
|
|
|
+ allArr.push(res.data.cjgshfwzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jykszxs,function(i){
|
|
|
+ allArr.push(res.data.jykszxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.xzfwzxs,function(i){
|
|
|
+ allArr.push(res.data.xzfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jzzxs,function(i){
|
|
|
+ allArr.push(res.data.jzzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jyhrczxs,function(i){
|
|
|
+ allArr.push(res.data.jyhrczxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.shbxswzxs,function(i){
|
|
|
+ allArr.push(res.data.shbxswzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.sqs,function(i){
|
|
|
+ allArr.push(res.data.sqs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.gjjs,function(i){
|
|
|
+ allArr.push(res.data.gjjs[i]);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ error: function(err) {},
|
|
|
+ });
|
|
|
+
|
|
|
+ var passid = localStorage.getItem("passid");
|
|
|
+ var filterId = allArr.filter(function(i){
|
|
|
+ return i.id == passid
|
|
|
+ });
|
|
|
+ xxGEO(filterId)
|
|
|
+ // var point = new BMap.Point(106.563, 29.523);
|
|
|
+
|
|
|
+ // var marker = new BMap.Marker(point, {
|
|
|
+ // enableDragging: true
|
|
|
+ // });
|
|
|
+
|
|
|
+ function xxGEO(arr) {
|
|
|
+ map.clearOverlays();
|
|
|
+ for (var z = 0; z < arr.length; z++) {
|
|
|
+ var add = arr[z].address;
|
|
|
+ const tempAdd = add;
|
|
|
+ myGeo.getPoint(tempAdd, function(point) {
|
|
|
+ if (point) {
|
|
|
+ var address = new BMap.Point(point.lng, point.lat);
|
|
|
+ getoldpoint = address;
|
|
|
+ for (var index = 0; index < arr.length; index++) {
|
|
|
+ var arrdep = arr[index].dep;
|
|
|
+ var arraddre = arr[index].address;
|
|
|
+ var arrtype = arr[index].type;
|
|
|
+ var arrspecial = arr[index].specialtype;
|
|
|
+ var arrtag = arr[index].tag;
|
|
|
+ var arrtag2 = arr[index].tag2;
|
|
|
+ var arrtag3 = arr[index].tag3;
|
|
|
+ var arrcontent = arr[index].content;
|
|
|
+ var arrimg = arr[index].img;
|
|
|
+ var arrtel = arr[index].tel;
|
|
|
+ var arrtime = arr[index].time;
|
|
|
+ var arrIndex = arr[index].clickIndex;
|
|
|
+ var arrUrl = arr[index].url;
|
|
|
+ var arrSptype = arr[index].sptype;
|
|
|
+ $('#newname').val(arrdep);
|
|
|
+ $('#newAddres').val(arraddre);
|
|
|
+ $('#newtel').val(arrtel);
|
|
|
+ $('#newtime').val(arrtime);
|
|
|
+ if (tempAdd == arraddre) {
|
|
|
+ addMarker(address,arrdep);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ function addMarker(point,dep) {
|
|
|
+ map.centerAndZoom(point, 18); // 初始化地图,设置中心点坐标和地图级别
|
|
|
+ var myIcon = new BMap.Icon("./img/location.png", new BMap.Size(40, 40));
|
|
|
+ var marker = new BMap.Marker(point, {
|
|
|
+ icon: myIcon,
|
|
|
+ enableDragging: true
|
|
|
+ });
|
|
|
+ marker.addEventListener("dragend", function (e) {
|
|
|
+ lngAndlat= new BMap.Point(e.point.lng, e.point.lat);
|
|
|
+ myGeo.getLocation(lngAndlat, function(rs){
|
|
|
+ var addComp = rs.addressComponents;
|
|
|
+ $('#newAddres').val(addComp.city + addComp.district + addComp.street + addComp.streetNumber)
|
|
|
+ })
|
|
|
+ });
|
|
|
+ map.addOverlay(marker);
|
|
|
+ marker.setLabel(new BMap.Label(dep,{offset:new BMap.Size(40,5)}));
|
|
|
+ }
|
|
|
+
|
|
|
+ $('.jcbtn2').click(function(){
|
|
|
+ var dep,oldAddress;
|
|
|
+ $.each(filterId,function(i){
|
|
|
+ dep=filterId[i].dep;
|
|
|
+ oldAddress=filterId[i].address;
|
|
|
+ })
|
|
|
+ var obj={
|
|
|
+ sMapId: passid,
|
|
|
+ addressName: dep,
|
|
|
+ originalAddress: oldAddress,
|
|
|
+ originalLongitude: getoldpoint.lng,
|
|
|
+ originalLatitude: getoldpoint.lat,
|
|
|
+ newAddress: $('#newAddres').val(),
|
|
|
+ newLongitude: lngAndlat.lng,
|
|
|
+ newLatitude: lngAndlat.lat,
|
|
|
+ errorState: 0
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ // url: PATH + '/mapdata/saveErrorLog',
|
|
|
+ url: "http://192.168.0.69:7777/mapdata/saveErrorLog",
|
|
|
+ type: 'Post',
|
|
|
+ data: obj,
|
|
|
+ async: false,
|
|
|
+ success: function (res) {
|
|
|
+ if(res) {
|
|
|
+ layer.msg('提交成功');
|
|
|
+ window.history.back();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(err) {}
|
|
|
+ })
|
|
|
+ })
|
|
|
+})
|