leaflet加载kml文件

需要在html中引入依赖包

 
  导入
parseKml(file){
  let result= window.URL.createObjectURL(file)
  omnivore.kml(result).addTo(this.map)//这里我的map主体
},
onBeforeUploadImage(file){
  if(file.name.endsWith('kml')){
    this.parseKml(file)
    return
  }
},

你可能感兴趣的:(leaflet加载kml文件)