【GIS】Leaflet坐标串

        
1、polygon
XY2YX(coordinates) {
var yx = [] for (let i = 0; i < coordinates.length; i++) { var yxChild = [] for (let j = 0; j < coordinates[i].length; j++) { yxChild.push([coordinates[i][j][1], coordinates[i][j][0]]) } yx.push(yxChild) } return yx;
}
2、lineString

  XY2YX_Line(coordinates) {
  var yx = []
  for (let i = 0; i < coordinates.length; i++) {
    yx.push([coordinates[i][1], coordinates[i][0]])
  }
  return yx;
 }

 

 

posted @ 2020-11-30 14:23  咸鱼翻身  阅读(275)  评论(1编辑  收藏  举报