|
@@ -40,9 +40,7 @@ export default {
|
|
// ToDo...
|
|
// ToDo...
|
|
},
|
|
},
|
|
map_left_click_callback: (obj, type, movement, event) => {
|
|
map_left_click_callback: (obj, type, movement, event) => {
|
|
- console.log(movement.position)
|
|
|
|
this.stores.$state.tankuangXY = { x: movement.position.x, y: movement.position.y };
|
|
this.stores.$state.tankuangXY = { x: movement.position.x, y: movement.position.y };
|
|
- // this.$store.commit("tankuangXY", { x: movement.position.x, y: movement.position.y });
|
|
|
|
},
|
|
},
|
|
map_right_click_callback: (obj) => {},
|
|
map_right_click_callback: (obj) => {},
|
|
};
|
|
};
|
|
@@ -51,63 +49,58 @@ export default {
|
|
window.jMap.createMap("mapF", res.data, window.location.origin, map_params, {});
|
|
window.jMap.createMap("mapF", res.data, window.location.origin, map_params, {});
|
|
// 地图背景样式
|
|
// 地图背景样式
|
|
window.jMap.switchBaseLayer("blue");
|
|
window.jMap.switchBaseLayer("blue");
|
|
- if(type == "anbao"){
|
|
|
|
-
|
|
|
|
- // var options = {
|
|
|
|
- // click: addLayerCallBack,
|
|
|
|
- // isZoom: false,
|
|
|
|
- // style: {
|
|
|
|
- // outline: true,
|
|
|
|
- // outlineColor: "rgb(255,0,0,0.8)",
|
|
|
|
- // material: "rgb(154,255,154,0)",
|
|
|
|
- // perPositionHeight: false,
|
|
|
|
- // height: 5,
|
|
|
|
- // width: 5,
|
|
|
|
- // label: {
|
|
|
|
- // show: true,
|
|
|
|
- // text: 'name',
|
|
|
|
- // font: "12px Helvetica",
|
|
|
|
- // fillColor: 'rgb(0,255,0,0.9)',
|
|
|
|
- // pixelOffset: [0, -40],
|
|
|
|
- // backgroundColor: 'rgb(0,0,0,0)',
|
|
|
|
- // showBackground: false
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // // where: "name = '莘庄镇'"
|
|
|
|
-
|
|
|
|
- // };
|
|
|
|
- // jMap.addLayer('mh_dyn_cywg', [0], options);
|
|
|
|
- // var options2 = {
|
|
|
|
- // click: addLayerCallBack,
|
|
|
|
- // isZoom: false,
|
|
|
|
- // style: {
|
|
|
|
- // outline: true,
|
|
|
|
- // outlineColor: "rgb(255,0,0,0.8)",
|
|
|
|
- // material: "rgb(154,255,154,0)",
|
|
|
|
- // perPositionHeight: false,
|
|
|
|
- // height: 5,
|
|
|
|
- // width: 5,
|
|
|
|
- // label: {
|
|
|
|
- // show: true,
|
|
|
|
- // text: 'name',
|
|
|
|
- // font: "12px Helvetica",
|
|
|
|
- // fillColor: 'rgb(0,255,0,0.9)',
|
|
|
|
- // pixelOffset: [0, -40],
|
|
|
|
- // backgroundColor: 'rgb(0,0,0,0)',
|
|
|
|
- // showBackground: false
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // where: "name = '赵家村村委会'"
|
|
|
|
-
|
|
|
|
- // };
|
|
|
|
- // jMap.addLayer('mh_dyn_district', [2], options2);
|
|
|
|
- // 点击事件回调函数
|
|
|
|
- function addLayerCallBack(obj) {
|
|
|
|
- console.log(obj);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取街镇信息
|
|
|
|
+ */
|
|
|
|
+ var options = {
|
|
|
|
+ click: addLayerCallBack,
|
|
|
|
+ isZoom: false,
|
|
|
|
+ style: {
|
|
|
|
+ outline: true,
|
|
|
|
+ outlineColor: "rgb(255,0,0,0.8)",
|
|
|
|
+ material: "rgb(154,255,154,0)",
|
|
|
|
+ perPositionHeight: false,
|
|
|
|
+ height: 5,
|
|
|
|
+ width: 5,
|
|
|
|
+ label: {
|
|
|
|
+ show: true,
|
|
|
|
+ text: "name",
|
|
|
|
+ font: "16px Helvetica",
|
|
|
|
+ fillColor: "rgb(0,255,0,0.9)",
|
|
|
|
+ pixelOffset: [0, -40],
|
|
|
|
+ backgroundColor: "rgb(0,0,0,0)",
|
|
|
|
+ showBackground: false,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ // where:"name = '莘庄镇'"
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ window.jMap.addLayer("mh_dyn_district", [1], options);
|
|
|
|
|
|
|
|
|
|
|
|
+ // 街镇标题绘制
|
|
|
|
+ // var qp = new JMapQueryParam({
|
|
|
|
+ // queryMapService: "mh_dyn_district",
|
|
|
|
+ // queryMapLayers: [1],
|
|
|
|
+ // outFields: ["code", "name", "center_x", "center_y"],
|
|
|
|
+ // // queryWhere: "name like '%莘庄镇%' ",
|
|
|
|
+ // callBack: (res) => {
|
|
|
|
+
|
|
|
|
+ // res.features.forEach(async(val) => {
|
|
|
|
+ // await window.jMap.FlagInfo.show({
|
|
|
|
+ // id: val.attributes.code,
|
|
|
|
+ // position: { x: Number(val.attributes.center_x), y: Number(val.attributes.center_y), z: 0 },
|
|
|
|
+ // element: `<div class='ysc-dynamic-layer ys-css3-box' onclick="vue.clickFlag(${val.attributes.code})">
|
|
|
|
+ // <div class='biaozhu' style="font-size:18px !important">${val.attributes.name} ${val.attributes.code}</div>
|
|
|
|
+ // </div>`,
|
|
|
|
+ // }, { isZoom: false });
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
|
|
+ // });
|
|
|
|
+ // new JMapQuery(window.jMap).execQuery(qp)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -209,15 +202,15 @@ export default {
|
|
id: idx,
|
|
id: idx,
|
|
attributes: {
|
|
attributes: {
|
|
name:
|
|
name:
|
|
- name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)"
|
|
|
|
|
|
+ name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)"
|
|
: name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)"
|
|
: name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)"
|
|
- : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)"
|
|
|
|
|
|
+ : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)"
|
|
: name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)"
|
|
: name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)"
|
|
- : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)"
|
|
|
|
|
|
+ : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)"
|
|
: name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)"
|
|
: name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)"
|
|
: name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)"
|
|
: name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)"
|
|
: name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)"
|
|
: name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)"
|
|
@@ -228,15 +221,15 @@ export default {
|
|
position: item,
|
|
position: item,
|
|
label: {
|
|
label: {
|
|
text:
|
|
text:
|
|
- name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)"
|
|
|
|
- : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)"
|
|
|
|
|
|
+ name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)"
|
|
|
|
+ : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)"
|
|
: name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)"
|
|
: name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)"
|
|
- : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)"
|
|
|
|
|
|
+ : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)"
|
|
: name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)"
|
|
: name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)"
|
|
- : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)"
|
|
|
|
|
|
+ : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)"
|
|
: name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)"
|
|
: name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)"
|
|
: name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)"
|
|
: name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)"
|
|
: name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)"
|
|
: name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)"
|
|
@@ -272,13 +265,7 @@ export default {
|
|
|
|
|
|
// 分布点点击事件的回调函数
|
|
// 分布点点击事件的回调函数
|
|
function regionLocateCallBack(obj) {
|
|
function regionLocateCallBack(obj) {
|
|
- console.log(234,obj._attributes.name); // obj为返回值
|
|
|
|
- console.log(that.stores)
|
|
|
|
that.stores.gridNameChange( obj._attributes.name);
|
|
that.stores.gridNameChange( obj._attributes.name);
|
|
- setTimeout(()=>{
|
|
|
|
- console.log(that.stores.$state.gridName)
|
|
|
|
- },1000)
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}, idx * 1)
|
|
}, idx * 1)
|