|
@@ -116,7 +116,7 @@ export default {
|
|
* @param {*} status 是否有图层
|
|
* @param {*} status 是否有图层
|
|
*/
|
|
*/
|
|
anbao(status,id){
|
|
anbao(status,id){
|
|
-
|
|
|
|
|
|
+ var that = this
|
|
var color = [
|
|
var color = [
|
|
// "#2c6395",
|
|
// "#2c6395",
|
|
// "#1b6cb6",
|
|
// "#1b6cb6",
|
|
@@ -154,7 +154,6 @@ export default {
|
|
];
|
|
];
|
|
var JmapQuery = new JMapQuery(window.jMap); // JMap为初始化地图时,实例化的JMap对象
|
|
var JmapQuery = new JMapQuery(window.jMap); // JMap为初始化地图时,实例化的JMap对象
|
|
if(status){
|
|
if(status){
|
|
- console.log(11111111)
|
|
|
|
window.jMap.Locate.clearLocate(); //清楚分布
|
|
window.jMap.Locate.clearLocate(); //清楚分布
|
|
// window.jMap.removeLayer(); // 空值清除所有已添加图层
|
|
// window.jMap.removeLayer(); // 空值清除所有已添加图层
|
|
}
|
|
}
|
|
@@ -250,7 +249,13 @@ export default {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
var options = {
|
|
var options = {
|
|
- isZoom: true,
|
|
|
|
|
|
+ isZoom: 10,
|
|
|
|
+ camera: {
|
|
|
|
+ x: 121.4175597,
|
|
|
|
+ y: 31.119248,
|
|
|
|
+ radius: 18000.0,
|
|
|
|
+ offset: { heading: -4, pitch: -70, range: 0 },
|
|
|
|
+ },
|
|
click: regionLocateCallBack,
|
|
click: regionLocateCallBack,
|
|
style: {
|
|
style: {
|
|
color: color[index],
|
|
color: color[index],
|
|
@@ -267,7 +272,13 @@ export default {
|
|
|
|
|
|
// 分布点点击事件的回调函数
|
|
// 分布点点击事件的回调函数
|
|
function regionLocateCallBack(obj) {
|
|
function regionLocateCallBack(obj) {
|
|
- console.log(obj); // obj为返回值
|
|
|
|
|
|
+ console.log(234,obj._attributes.name); // obj为返回值
|
|
|
|
+ console.log(that.stores)
|
|
|
|
+ that.stores.gridNameChange( obj._attributes.name);
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ console.log(that.stores.$state.gridName)
|
|
|
|
+ },1000)
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}, idx * 1)
|
|
}, idx * 1)
|
|
@@ -381,7 +392,6 @@ export default {
|
|
}
|
|
}
|
|
// name2.push(obj.features[i].attributes.name)
|
|
// name2.push(obj.features[i].attributes.name)
|
|
}
|
|
}
|
|
- console.log(a)
|
|
|
|
var big2Arr = []
|
|
var big2Arr = []
|
|
obj.features.forEach(function(item, index) {
|
|
obj.features.forEach(function(item, index) {
|
|
var b2 = item.geometry.rings;
|
|
var b2 = item.geometry.rings;
|
|
@@ -397,11 +407,6 @@ export default {
|
|
big2Arr.push(newArr2);
|
|
big2Arr.push(newArr2);
|
|
name2.push(item.attributes.name)
|
|
name2.push(item.attributes.name)
|
|
})
|
|
})
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
})
|
|
})
|
|
|
|
|
|
big2Arr.forEach(function(item, index) {
|
|
big2Arr.forEach(function(item, index) {
|
|
@@ -425,7 +430,7 @@ export default {
|
|
isZoom: true,
|
|
isZoom: true,
|
|
click: regionLocateCallBack2,
|
|
click: regionLocateCallBack2,
|
|
style: {
|
|
style: {
|
|
- color: "red",
|
|
|
|
|
|
+ color: "#68afc1",
|
|
transparency: 0.6,
|
|
transparency: 0.6,
|
|
outline: true,
|
|
outline: true,
|
|
outlineColor: 'blue',
|
|
outlineColor: 'blue',
|
|
@@ -435,8 +440,6 @@ export default {
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
jMap.Locate.regionLocate(target, options);
|
|
jMap.Locate.regionLocate(target, options);
|
|
},500)
|
|
},500)
|
|
-
|
|
|
|
-
|
|
|
|
// 分布点点击事件的回调函数
|
|
// 分布点点击事件的回调函数
|
|
function regionLocateCallBack2(obj) {
|
|
function regionLocateCallBack2(obj) {
|
|
console.log(obj); // obj为返回值
|
|
console.log(obj); // obj为返回值
|