|
@@ -749,7 +749,6 @@ $(function() {
|
|
|
break;
|
|
|
case "商圈":
|
|
|
xxGEO(sq);
|
|
|
- // addresspostajax(sq);
|
|
|
xrxx(sq);
|
|
|
break;
|
|
|
case "核酸采样点":
|
|
@@ -759,36 +758,6 @@ $(function() {
|
|
|
}
|
|
|
$('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
});
|
|
|
- function addresspostajax(arr){
|
|
|
- var mapList=[];
|
|
|
- var obj;
|
|
|
- var dataString;
|
|
|
- $.each(arr,function(i){
|
|
|
- var add = arr[i].address;
|
|
|
- const tempAdd = add;
|
|
|
- myGeo.getPoint(tempAdd, function(point) {
|
|
|
- if(point){
|
|
|
- var address = new BMap.Point(point.lng, point.lat);
|
|
|
- obj = {
|
|
|
- id: arr[i].id,
|
|
|
- longitude: address.lng,
|
|
|
- latitude: address.lat,
|
|
|
- }
|
|
|
- mapList.push(JSON.stringify(obj));
|
|
|
- }
|
|
|
- },'重庆市')
|
|
|
- });
|
|
|
- dataString=JSON.stringify(mapList);
|
|
|
- console.log(JSON.stringify(mapList))
|
|
|
- $.ajax({
|
|
|
- type: 'POST',
|
|
|
- url: PATH + '/mapdata/longitudeLatitude',
|
|
|
- // url: "http://192.168.0.230:7777/mapdata/longitudeLatitude",
|
|
|
- async: false,
|
|
|
- dataType: 'json',
|
|
|
- data: {"dataString":dataString}
|
|
|
- })
|
|
|
- }
|
|
|
|
|
|
// 点击列表中的一条,重置地图中心点
|
|
|
$(document).on('click', '.title-first li', function() {
|
|
@@ -1331,171 +1300,194 @@ $(function() {
|
|
|
}
|
|
|
|
|
|
// 将json数据渲染到地图
|
|
|
- function xxGEO(arr) {
|
|
|
+ async function xxGEO(arr) {
|
|
|
map.clearOverlays();
|
|
|
- var addFirst;
|
|
|
- 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);
|
|
|
- addFirst = 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;
|
|
|
- var arrgzh = arr[index].gzh
|
|
|
- var sContnet = ''
|
|
|
- sContnet += "<ul class='titleFirst'>"
|
|
|
- sContnet += "<li class='title_flex' title='"+arrdep+"'>"
|
|
|
- sContnet += arrdep
|
|
|
- if ((arrtype == null || arrtype == undefined)||arrtype=='') {
|
|
|
- sContnet += ''
|
|
|
- } else {
|
|
|
- if (arrspecial == "中学") {
|
|
|
- if (arrtype == "中学"){
|
|
|
+ var dataString,addFirst;
|
|
|
+ var mapList=[];
|
|
|
+ if (!arr){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ for (var z = 0; z < arr.length; z++) {
|
|
|
+ var add = arr[z].address;
|
|
|
+ const tempAdd = add;
|
|
|
+ await new Promise((resolve, reject) => {
|
|
|
+ myGeo.getPoint(tempAdd, function(point) {
|
|
|
+ if (point) {
|
|
|
+ var address = new BMap.Point(point.lng, point.lat);
|
|
|
+ addFirst = address;
|
|
|
+ var obj = {
|
|
|
+ "id": arr[z].id,
|
|
|
+ "longitude": address.lng,
|
|
|
+ "latitude": address.lat
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ var arrgzh = arr[index].gzh
|
|
|
+ var sContnet = ''
|
|
|
+ sContnet += "<ul class='titleFirst'>"
|
|
|
+ sContnet += "<li class='title_flex' title='"+arrdep+"'>"
|
|
|
+ sContnet += arrdep
|
|
|
+ if ((arrtype == null || arrtype == undefined)||arrtype=='') {
|
|
|
sContnet += ''
|
|
|
} else {
|
|
|
- sContnet += "<p class='flex_blue'>· "
|
|
|
- sContnet += arrtype
|
|
|
+ if (arrspecial == "中学") {
|
|
|
+ if (arrtype == "中学"){
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<p class='flex_blue'>· "
|
|
|
+ sContnet += arrtype
|
|
|
+ sContnet += "</p>"
|
|
|
+ }
|
|
|
+ sContnet += "<p class='flex_blue'>· "
|
|
|
+ sContnet += arrspecial
|
|
|
+ sContnet += "</p>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<p class='flex_blue'>· "
|
|
|
+ sContnet += arrtype
|
|
|
+ sContnet += "</p>"
|
|
|
+ }
|
|
|
+ sContnet += "</li>"
|
|
|
+ }
|
|
|
+ if ((arrtag == null || arrtag == undefined)||arrtag=='') {
|
|
|
+ sContnet += ""
|
|
|
+ } else {
|
|
|
+ sContnet += "<li class='flex_orange'>"
|
|
|
+ sContnet += "<div class='three_tag'>"
|
|
|
+ sContnet += arrtag
|
|
|
+ if ((arrtag2 == undefined || arrtag2 == null)||arrtag2=='') {
|
|
|
+ sContnet += "</div>"
|
|
|
+ } else {
|
|
|
+ sContnet += "</div>"
|
|
|
+ sContnet += "<div class='three_tag'>"
|
|
|
+ sContnet += arrtag2
|
|
|
+ sContnet += "</div>"
|
|
|
+ }
|
|
|
+ if ((arrtag3 == undefined || arrtag3 == null)||arrtag3=='') {
|
|
|
+ sContnet += "</li>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<div class='three_tag'>"
|
|
|
+ sContnet += arrtag3
|
|
|
+ sContnet += "</div>"
|
|
|
+ sContnet += "</li>"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (arrcontent == "") {
|
|
|
+ sContnet += ''
|
|
|
+ } else if (arrcontent == undefined || arrcontent == null) {
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<li>"
|
|
|
+ sContnet += "<a class='a_blue'>"
|
|
|
+ sContnet += "<p class='content_p'>"
|
|
|
+ sContnet += arrcontent
|
|
|
sContnet += "</p>"
|
|
|
+ sContnet += "</a>"
|
|
|
}
|
|
|
- sContnet += "<p class='flex_blue'>· "
|
|
|
- sContnet += arrspecial
|
|
|
- sContnet += "</p>"
|
|
|
- } else {
|
|
|
- sContnet += "<p class='flex_blue'>· "
|
|
|
- sContnet += arrtype
|
|
|
+ sContnet += "</li>"
|
|
|
+ if (arrimg == "") {
|
|
|
+ sContnet += ''
|
|
|
+ } else if (arrimg == undefined || arrimg == null) {
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<li class='img_box'>"
|
|
|
+ sContnet += "<img class='two_img' src='" +PATH+arrimg + "'>"
|
|
|
+ sContnet += "</li>"
|
|
|
+ }
|
|
|
+ sContnet += "<li class='address_box'>"
|
|
|
+ sContnet += "<p><span class='flex_address'>地址:</span>"
|
|
|
+ sContnet += arraddre
|
|
|
sContnet += "</p>"
|
|
|
- }
|
|
|
- sContnet += "</li>"
|
|
|
- }
|
|
|
- if ((arrtag == null || arrtag == undefined)||arrtag=='') {
|
|
|
- sContnet += ""
|
|
|
- } else {
|
|
|
- sContnet += "<li class='flex_orange'>"
|
|
|
- sContnet += "<div class='three_tag'>"
|
|
|
- sContnet += arrtag
|
|
|
- if ((arrtag2 == undefined || arrtag2 == null)||arrtag2=='') {
|
|
|
- sContnet += "</div>"
|
|
|
- } else {
|
|
|
- sContnet += "</div>"
|
|
|
- sContnet += "<div class='three_tag'>"
|
|
|
- sContnet += arrtag2
|
|
|
- sContnet += "</div>"
|
|
|
- }
|
|
|
- if ((arrtag3 == undefined || arrtag3 == null)||arrtag3=='') {
|
|
|
+ if ((arrtime == null || arrtime == undefined)||arrtime=='') {
|
|
|
+ sContnet += ''
|
|
|
+ } else if(arrSptype == '查阅场所'){
|
|
|
+ sContnet += "<p><span class='flex_address'>查询时间:</span>"
|
|
|
+ sContnet += arrtime
|
|
|
+ sContnet += "</p>"
|
|
|
+ } else if(arrSptype == '受理场所'){
|
|
|
+ sContnet += "<p><span class='flex_address'>受理时间:</span>"
|
|
|
+ sContnet += arrtime
|
|
|
+ sContnet += "</p>"
|
|
|
+ } else if(arrSptype == '政务服务'){
|
|
|
+ sContnet += "<p><span class='flex_address'>办理时间:</span>"
|
|
|
+ sContnet += arrtime
|
|
|
+ sContnet += "</p>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<p><span class='flex_address'>办公时间:</span>"
|
|
|
+ sContnet += arrtime
|
|
|
+ sContnet += "</p>"
|
|
|
+ }
|
|
|
+ if ((arrtel == null || arrtel == undefined)||arrtel==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<p><span class='flex_address'>办公电话:</span>"
|
|
|
+ sContnet += arrtel
|
|
|
+ sContnet += "</p>"
|
|
|
+ }
|
|
|
+ if ((arrUrl == undefined || arrUrl == null)||arrUrl=='') {
|
|
|
+ sContnet += ''
|
|
|
+ } else if(arrSptype == "民政服务") {
|
|
|
+ sContnet += "<a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>预约祭扫</a>"
|
|
|
+ }else if(arrSptype == "住房保障"){
|
|
|
+ sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>公租房申请</a>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>在线预约</a>"
|
|
|
+ }
|
|
|
+ sContnet += "<br><a class='correct_html' style='color: #2775CC;text-decoration:underline;'>我要纠错</a>"
|
|
|
sContnet += "</li>"
|
|
|
- } else {
|
|
|
- sContnet += "<div class='three_tag'>"
|
|
|
- sContnet += arrtag3
|
|
|
- sContnet += "</div>"
|
|
|
+ if ((arrgzh == undefined || arrgzh == null)||arrgzh==''){
|
|
|
+ sContnet += ''
|
|
|
+ }else if(arrSptype=="交通服务"){
|
|
|
+ sContnet += "<li class='gzh_img'>"
|
|
|
+ sContnet += "<img class='two_img' src='" +PATH+arrgzh + "'>"
|
|
|
+ sContnet += "<p>微信扫描公众号办理</p>"
|
|
|
+ sContnet += "</li>"
|
|
|
+ }else{
|
|
|
+ sContnet += "<li class='gzh_img'>"
|
|
|
+ sContnet += "<img class='two_img' src='" +PATH+arrgzh + "'>"
|
|
|
+ sContnet += "<p>微信扫描公众号预约挂号</p>"
|
|
|
+ sContnet += "</li>"
|
|
|
+ }
|
|
|
+ sContnet += "<li class='btn_box'>"
|
|
|
+ sContnet += "<button class='one_bus'>公交</button>"
|
|
|
+ sContnet += "<button class='two_car'>自驾</button>"
|
|
|
sContnet += "</li>"
|
|
|
+ sContnet += "</ul>"
|
|
|
+ if (tempAdd == arraddre) {
|
|
|
+ addMarker2(arrIndex, index, address, new BMap.InfoWindow(sContnet, arraddre), arrdep);
|
|
|
+ }
|
|
|
+ document.querySelectorAll(".two_img").onload = function() {
|
|
|
+ infoWindow.redraw();
|
|
|
+ }
|
|
|
}
|
|
|
+ mapList.push(obj);
|
|
|
+ resolve();
|
|
|
}
|
|
|
- if (arrcontent == "") {
|
|
|
- sContnet += ''
|
|
|
- } else if (arrcontent == undefined || arrcontent == null) {
|
|
|
- sContnet += ''
|
|
|
- } else {
|
|
|
- sContnet += "<li>"
|
|
|
- sContnet += "<a class='a_blue'>"
|
|
|
- sContnet += "<p class='content_p'>"
|
|
|
- sContnet += arrcontent
|
|
|
- sContnet += "</p>"
|
|
|
- sContnet += "</a>"
|
|
|
- }
|
|
|
- sContnet += "</li>"
|
|
|
- if (arrimg == "") {
|
|
|
- sContnet += ''
|
|
|
- } else if (arrimg == undefined || arrimg == null) {
|
|
|
- sContnet += ''
|
|
|
- } else {
|
|
|
- sContnet += "<li class='img_box'>"
|
|
|
- sContnet += "<img class='two_img' src='" +PATH+arrimg + "'>"
|
|
|
- sContnet += "</li>"
|
|
|
- }
|
|
|
- sContnet += "<li class='address_box'>"
|
|
|
- sContnet += "<p><span class='flex_address'>地址:</span>"
|
|
|
- sContnet += arraddre
|
|
|
- sContnet += "</p>"
|
|
|
- if ((arrtime == null || arrtime == undefined)||arrtime=='') {
|
|
|
- sContnet += ''
|
|
|
- } else if(arrSptype == '查阅场所'){
|
|
|
- sContnet += "<p><span class='flex_address'>查询时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- } else if(arrSptype == '受理场所'){
|
|
|
- sContnet += "<p><span class='flex_address'>受理时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- } else if(arrSptype == '政务服务'){
|
|
|
- sContnet += "<p><span class='flex_address'>办理时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- } else {
|
|
|
- sContnet += "<p><span class='flex_address'>办公时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- }
|
|
|
- if ((arrtel == null || arrtel == undefined)||arrtel==''){
|
|
|
- sContnet += ''
|
|
|
- } else {
|
|
|
- sContnet += "<p><span class='flex_address'>办公电话:</span>"
|
|
|
- sContnet += arrtel
|
|
|
- sContnet += "</p>"
|
|
|
- }
|
|
|
- if ((arrUrl == undefined || arrUrl == null)||arrUrl=='') {
|
|
|
- sContnet += ''
|
|
|
- } else if(arrSptype == "民政服务") {
|
|
|
- sContnet += "<a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>预约祭扫</a>"
|
|
|
- }else if(arrSptype == "住房保障"){
|
|
|
- sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>公租房申请</a>"
|
|
|
- } else {
|
|
|
- sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>在线预约</a>"
|
|
|
- }
|
|
|
- sContnet += "<br><a class='correct_html' style='color: #2775CC;text-decoration:underline;'>我要纠错</a>"
|
|
|
- sContnet += "</li>"
|
|
|
- if ((arrgzh == undefined || arrgzh == null)||arrgzh==''){
|
|
|
- sContnet += ''
|
|
|
- }else if(arrSptype=="交通服务"){
|
|
|
- sContnet += "<li class='gzh_img'>"
|
|
|
- sContnet += "<img class='two_img' src='" +PATH+arrgzh + "'>"
|
|
|
- sContnet += "<p>微信扫描公众号办理</p>"
|
|
|
- sContnet += "</li>"
|
|
|
- }else{
|
|
|
- sContnet += "<li class='gzh_img'>"
|
|
|
- sContnet += "<img class='two_img' src='" +PATH+arrgzh + "'>"
|
|
|
- sContnet += "<p>微信扫描公众号预约挂号</p>"
|
|
|
- sContnet += "</li>"
|
|
|
- }
|
|
|
- sContnet += "<li class='btn_box'>"
|
|
|
- sContnet += "<button class='one_bus'>公交</button>"
|
|
|
- sContnet += "<button class='two_car'>自驾</button>"
|
|
|
- sContnet += "</li>"
|
|
|
- sContnet += "</ul>"
|
|
|
- if (tempAdd == arraddre) {
|
|
|
- addMarker2(arrIndex, index, address, new BMap.InfoWindow(sContnet, arraddre), arrdep);
|
|
|
- }
|
|
|
- document.querySelectorAll(".two_img").onload = function() {
|
|
|
- infoWindow.redraw();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }, "重庆市");
|
|
|
+ }, "重庆市");
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+ dataString=JSON.stringify(mapList);
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: PATH + '/mapdata/longitudeLatitude',
|
|
|
+ // url: "http://192.168.0.230:7777/mapdata/longitudeLatitude",
|
|
|
+ async: false,
|
|
|
+ dataType: 'json',
|
|
|
+ data: {"dataString":dataString}
|
|
|
+ })
|
|
|
};
|
|
|
|
|
|
function addGEO(arr){
|