GeoJson ======>KML

GeoJson转KML``

npm install --save tokml 
import otkml from 'tokml' //在要使用的地方加入
//准备你的geojson
{
  "features": [
    {
      "geometry": {
        "coordinates": [
          [
            [
              119.101111,
              19.119722
            ],
            [
              119.129167,
              19.568611
            ],
            [
              118.080556,
              19.624167
            ],
            [
              118.080556,
              19.175
            ],
            [
              119.101111,
              19.119722
            ]
          ]
        ],
        "type": "Polygon"
      },
      "type": "Feature",
      "properties": {}
    },
    {
      "geometry": {
        "coordinates": [
          [
            [
              124.003611,
              18.754722
            ],
            [
              124.045833,
              19.2025
            ],
            [
              122.621944,
              19.3175
            ],
            [
              122.583611,
              18.869167
            ],
            [
              124.003611,
              18.754722
            ]
          ]
        ],
        "type": "Polygon"
      },
      "type": "Feature",
      "properties": {}
    },
    {
      "geometry": {
        "coordinates": [
          [
            [
              148.946667,
              14.414167
            ],
            [
              149.156389,
              15.290556
            ],
            [
              146.971667,
              15.7675
            ],
            [
              146.770556,
              14.889444
            ],
            [
              148.946667,
              14.414167
            ]
          ]
        ],
        "type": "Polygon"
      },
      "type": "Feature",
      "properties": {}
    }
  ],
  "type": "FeatureCollection"
}
//  kml 是一串 KML 数据,geojsonObject 是一个 JavaScript 对象
//  GeoJSON 数据
var  kml  = tokml ( geojsonObject ) ; 

api ====> 走你

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值