|
|
@ -117,16 +117,17 @@ Page({ |
|
|
|
$api.AJAX('GET', 'applets/landlistedlonlat/list/' + id, { |
|
|
|
$api.AJAX('GET', 'applets/landlistedlonlat/list/' + id, { |
|
|
|
landListedId: id |
|
|
|
landListedId: id |
|
|
|
}, true).then(res => { |
|
|
|
}, true).then(res => { |
|
|
|
console.log(res); |
|
|
|
if (res&&res.data&&res.data.length > 0) { |
|
|
|
if (res.data.length > 0) { |
|
|
|
|
|
|
|
centerPoint = res.data[0].centerPoint; |
|
|
|
|
|
|
|
this.setWKT1(res, 2) |
|
|
|
this.setWKT1(res, 2) |
|
|
|
|
|
|
|
if(res.data[0].centerPoint){ |
|
|
|
|
|
|
|
centerPoint = res.data[0].centerPoint; |
|
|
|
let point = WKT.parse(centerPoint); |
|
|
|
let point = WKT.parse(centerPoint); |
|
|
|
this.setData({ |
|
|
|
this.setData({ |
|
|
|
latitude: point.coordinates[1], |
|
|
|
latitude: point.coordinates[1], |
|
|
|
longitude: point.coordinates[0], |
|
|
|
longitude: point.coordinates[0], |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
$api.getLandDetail(this.data.landListedId).then(res => { |
|
|
|
$api.getLandDetail(this.data.landListedId).then(res => { |
|
|
@ -196,10 +197,10 @@ Page({ |
|
|
|
let { |
|
|
|
let { |
|
|
|
polygons |
|
|
|
polygons |
|
|
|
} = this.data; |
|
|
|
} = this.data; |
|
|
|
let newPolygons = data.data.map(item => { |
|
|
|
let newPolygons = data.data.filter(item=>{ |
|
|
|
console.log(item); |
|
|
|
return item.geoms || item.geom; |
|
|
|
|
|
|
|
}).map(item => { |
|
|
|
let geomPoints = WKT.parse(item.geoms || item.geom); |
|
|
|
let geomPoints = WKT.parse(item.geoms || item.geom); |
|
|
|
console.log(geomPoints); |
|
|
|
|
|
|
|
let points = []; |
|
|
|
let points = []; |
|
|
|
geomPoints.coordinates[0].forEach(ele => { |
|
|
|
geomPoints.coordinates[0].forEach(ele => { |
|
|
|
if (typeof (ele[0]) === 'number') { |
|
|
|
if (typeof (ele[0]) === 'number') { |
|
|
|