|
|
@ -184,17 +184,23 @@ Page({ |
|
|
|
let log = number.substr(l, z - l); |
|
|
|
let log = number.substr(l, z - l); |
|
|
|
let lag = number.substr(z, r - z); |
|
|
|
let lag = number.substr(z, r - z); |
|
|
|
|
|
|
|
|
|
|
|
console.log(lag, log) |
|
|
|
// console.log(data)
|
|
|
|
let polygon = this.wkt2polygon(data.data[0].geom); |
|
|
|
|
|
|
|
polygon.strokeColor = '#fe00fe'; |
|
|
|
this.setWKT1(data, 2) |
|
|
|
polygon.strokeWidth = 2; |
|
|
|
// let polygon = this.wkt2polygon(data.data[0].geom);
|
|
|
|
polygon.fillColor = '#00fe04' + util.ten2XO(50); |
|
|
|
// polygon.strokeColor = '#fe00fe';
|
|
|
|
let polygons = [polygon]; |
|
|
|
// polygon.strokeWidth = 2;
|
|
|
|
|
|
|
|
// polygon.fillColor = '#00fe04' + util.ten2XO(50);
|
|
|
|
|
|
|
|
// let polygons = [polygon];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
polygons, |
|
|
|
// polygons,
|
|
|
|
latitude: lag, |
|
|
|
latitude: lag, |
|
|
|
longitude: log, |
|
|
|
longitude: log, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.addFeaturesToList(data, 2); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -250,7 +256,7 @@ Page({ |
|
|
|
dialogVisible: true, |
|
|
|
dialogVisible: true, |
|
|
|
}); |
|
|
|
}); |
|
|
|
global.selectFeature = feature; |
|
|
|
global.selectFeature = feature; |
|
|
|
// console.log(feature)
|
|
|
|
console.log(555, feature) |
|
|
|
//tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。
|
|
|
|
//tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。
|
|
|
|
let tid = feature.tid;//tid:1,2,3
|
|
|
|
let tid = feature.tid;//tid:1,2,3
|
|
|
|
//属性property 包含 地块id字段,按需使用。
|
|
|
|
//属性property 包含 地块id字段,按需使用。
|
|
|
@ -259,10 +265,10 @@ Page({ |
|
|
|
console.log('添加---接口对接---获取地块数据------以下全部替换') |
|
|
|
console.log('添加---接口对接---获取地块数据------以下全部替换') |
|
|
|
//变量 tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。
|
|
|
|
//变量 tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。
|
|
|
|
//变量 property 包含 地块id字段,按需使用。
|
|
|
|
//变量 property 包含 地块id字段,按需使用。
|
|
|
|
// console.log(property);
|
|
|
|
console.log(121212, property); |
|
|
|
// console.log(tid);
|
|
|
|
// console.log(tid);
|
|
|
|
if (tid == 1 || tid == 2) { |
|
|
|
if (tid == 1 || tid == 2) { |
|
|
|
$apiT.AJAX('GET', 'applets/landlisted/' + property.land_listed_id, true).then(res => { |
|
|
|
$apiT.AJAX('GET', 'applets/landlisted/' + (property.land_listed_id || property.landListedId), true).then(res => { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
titleLand: res.data.landCode, |
|
|
|
titleLand: res.data.landCode, |
|
|
|
landListedId: res.data.landListedId, |
|
|
|
landListedId: res.data.landListedId, |
|
|
@ -273,7 +279,7 @@ Page({ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$apiT.AJAX('GET', 'applets/landtolist/' + property.proposedseria_id, true).then(res => { |
|
|
|
$apiT.AJAX('GET', 'applets/landtolist/' + (property.proposedseria_id || property.proposedseriaId), true).then(res => { |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
titleLand: res.data.landCode, |
|
|
|
titleLand: res.data.landCode, |
|
|
|
landListedId: res.data.proposedseriaId, |
|
|
|
landListedId: res.data.proposedseriaId, |
|
|
@ -491,6 +497,7 @@ Page({ |
|
|
|
longitude |
|
|
|
longitude |
|
|
|
} = e.detail; |
|
|
|
} = e.detail; |
|
|
|
let point = { latitude, longitude } // 地图点击点的经纬度
|
|
|
|
let point = { latitude, longitude } // 地图点击点的经纬度
|
|
|
|
|
|
|
|
console.log(point); |
|
|
|
let features = that.selectFeatureList(point); |
|
|
|
let features = that.selectFeatureList(point); |
|
|
|
console.log(features); |
|
|
|
console.log(features); |
|
|
|
if (features && features.length > 0) { |
|
|
|
if (features && features.length > 0) { |
|
|
@ -674,8 +681,10 @@ Page({ |
|
|
|
that.setData({ |
|
|
|
that.setData({ |
|
|
|
// latitude: latitude,
|
|
|
|
// latitude: latitude,
|
|
|
|
// longitude: longitude,
|
|
|
|
// longitude: longitude,
|
|
|
|
latitude: '29.57', |
|
|
|
// latitude: '29.57',
|
|
|
|
longitude: '106.55', |
|
|
|
// longitude: '106.55',
|
|
|
|
|
|
|
|
latitude: '29.53864220087573', |
|
|
|
|
|
|
|
longitude: '106.50061908820558', |
|
|
|
centerLocation: { |
|
|
|
centerLocation: { |
|
|
|
latitude, |
|
|
|
latitude, |
|
|
|
longitude, |
|
|
|
longitude, |
|
|
@ -777,7 +786,7 @@ Page({ |
|
|
|
addFeaturesToList(data, tid) { |
|
|
|
addFeaturesToList(data, tid) { |
|
|
|
let key = 'key' + tid; |
|
|
|
let key = 'key' + tid; |
|
|
|
let features = data.data.map(item => { |
|
|
|
let features = data.data.map(item => { |
|
|
|
let geomPoints = WKT.parse(item.geoms).coordinates; |
|
|
|
let geomPoints = WKT.parse(item.geoms || item.geom).coordinates; |
|
|
|
let properties = item; |
|
|
|
let properties = item; |
|
|
|
properties.tid = tid;//类型
|
|
|
|
properties.tid = tid;//类型
|
|
|
|
let polygon = { |
|
|
|
let polygon = { |
|
|
@ -889,7 +898,7 @@ Page({ |
|
|
|
} = this.data; |
|
|
|
} = this.data; |
|
|
|
let newPolygons = data.data.map(item => { |
|
|
|
let newPolygons = data.data.map(item => { |
|
|
|
console.log(item); |
|
|
|
console.log(item); |
|
|
|
let geomPoints = WKT.parse(item.geoms); |
|
|
|
let geomPoints = WKT.parse(item.geoms || item.geom); |
|
|
|
console.log(geomPoints); |
|
|
|
console.log(geomPoints); |
|
|
|
let points = []; |
|
|
|
let points = []; |
|
|
|
geomPoints.coordinates[0].forEach(ele => { |
|
|
|
geomPoints.coordinates[0].forEach(ele => { |
|
|
@ -926,6 +935,50 @@ Page({ |
|
|
|
polygons |
|
|
|
polygons |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//复制了一份,因为参数问题
|
|
|
|
|
|
|
|
setWKT1(data, id) { |
|
|
|
|
|
|
|
let { |
|
|
|
|
|
|
|
polygons |
|
|
|
|
|
|
|
} = this.data; |
|
|
|
|
|
|
|
let newPolygons = data.data.map(item => { |
|
|
|
|
|
|
|
console.log(item); |
|
|
|
|
|
|
|
let geomPoints = WKT.parse(item.geoms || item.geom); |
|
|
|
|
|
|
|
console.log(geomPoints); |
|
|
|
|
|
|
|
let points = []; |
|
|
|
|
|
|
|
geomPoints.coordinates[0].forEach(ele => { |
|
|
|
|
|
|
|
if (typeof (ele[0]) === 'number') { |
|
|
|
|
|
|
|
points.push({ |
|
|
|
|
|
|
|
longitude: ele[0], |
|
|
|
|
|
|
|
latitude: ele[1] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
points = ele.map(once => { |
|
|
|
|
|
|
|
let lonlat = { |
|
|
|
|
|
|
|
longitude: once[0], |
|
|
|
|
|
|
|
latitude: once[1] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return lonlat |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
let strokeColor = '' + item.lineColor + util.ten2XO(item.lineOpaqueness); |
|
|
|
|
|
|
|
let strokeWidth = item.strokeWidth ? Number(item.strokeWidth) : 2; |
|
|
|
|
|
|
|
let fillColor = '' + item.fillColor + util.ten2XO(item.fillOpaqueness); |
|
|
|
|
|
|
|
let polygon = { |
|
|
|
|
|
|
|
points, |
|
|
|
|
|
|
|
strokeColor, |
|
|
|
|
|
|
|
strokeWidth, |
|
|
|
|
|
|
|
fillColor, |
|
|
|
|
|
|
|
zIndex: 1, |
|
|
|
|
|
|
|
id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return polygon |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
polygons = polygons.concat(newPolygons); |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
|
|
polygons |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|