Browse Source

小程序地图展示线宽修改

master
王健 4 years ago
parent
commit
6d749fa8b6
  1. 12
      pages/look-detail/look-detail.js
  2. 66
      pages/look/look.js
  3. 12
      pages/lookStay-detail/lookStay-detail.js

12
pages/look-detail/look-detail.js

@ -218,9 +218,15 @@ Page({
})
}
})
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 strokeColor;
let fillColor;
if(item.lineColor){
strokeColor = '' + item.lineColor + util.ten2XO(item.lineOpaqueness);
}
let strokeWidth = item.lineWidth ? Number(item.lineWidth) : 2;
if(item.fillColor){
fillColor = '' + item.fillColor + util.ten2XO(item.fillOpaqueness);
}
let polygon = {
points,
strokeColor,

66
pages/look/look.js

@ -180,22 +180,9 @@ Page({
let l = number.indexOf('(') + 1;
let z = number.indexOf(' ');
let r = number.indexOf(')');
console.log(l, z, r)
let log = number.substr(l, z - l);
let lag = number.substr(z, r - z);
// console.log(data)
this.setWKT1(data, 2)
// let polygon = this.wkt2polygon(data.data[0].geom);
// polygon.strokeColor = '#fe00fe';
// polygon.strokeWidth = 2;
// polygon.fillColor = '#00fe04' + util.ten2XO(50);
// let polygons = [polygon];
this.setData({
// polygons,
latitude: lag,
@ -205,33 +192,6 @@ Page({
}
})
},
wkt2polygon(geom) {
let geomPoints = WKT.parse(geom);
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 polygon = {
points,
zIndex: 1,
}
return polygon;
},
bindPickerChangeStart(e) {
let sIdx = Number(e.detail.value);
if (sIdx > this.data.indexEnd) {
@ -906,7 +866,6 @@ Page({
return item.geoms || item.geom;
}).map(item => {
let geomPoints = WKT.parse(item.geoms || item.geom);
console.log(geomPoints);
let points = [];
geomPoints.coordinates[0].forEach(ele => {
if (typeof (ele[0]) === 'number') {
@ -924,9 +883,15 @@ Page({
})
}
})
let strokeColor = '' + item.line_color + util.ten2XO(item.line_opaqueness);
let strokeWidth = item.strokeWidth ? Number(item.strokeWidth) : 2;
let fillColor = '' + item.fill_color + util.ten2XO(item.fill_opaqueness);
let strokeColor;
let fillColor;
if(item.line_color){
strokeColor = '' + item.line_color + util.ten2XO(item.line_opaqueness);
}
let strokeWidth = item.line_width ? Number(item.line_width) : 2;
if(item.fill_color){
fillColor = '' + item.fill_color + util.ten2XO(item.fill_opaqueness);
}
let polygon = {
points,
strokeColor,
@ -951,7 +916,6 @@ Page({
return item.geoms || item.geom;
}).map(item => {
let geomPoints = WKT.parse(item.geoms || item.geom);
console.log(geomPoints);
let points = [];
geomPoints.coordinates[0].forEach(ele => {
if (typeof (ele[0]) === 'number') {
@ -969,9 +933,15 @@ Page({
})
}
})
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 strokeColor;
let fillColor;
if(item.lineColor){
strokeColor = '' + item.lineColor + util.ten2XO(item.lineOpaqueness);
}
let strokeWidth = item.lineWidth ? Number(item.lineWidth) : 2;
if(item.fillColor){
fillColor = '' + item.fillColor + util.ten2XO(item.fillOpaqueness);
}
let polygon = {
points,
strokeColor,

12
pages/lookStay-detail/lookStay-detail.js

@ -195,9 +195,15 @@ Page({
})
}
})
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 strokeColor;
let fillColor;
if(item.lineColor){
strokeColor = '' + item.lineColor + util.ten2XO(item.lineOpaqueness);
}
let strokeWidth = item.lineWidth ? Number(item.lineWidth) : 2;
if(item.fillColor){
fillColor = '' + item.fillColor + util.ten2XO(item.fillOpaqueness);
}
let polygon = {
points,
strokeColor,

Loading…
Cancel
Save