Openlayers combat: drawing graphics, exporting geojson files

GeoJSON format data has a very important position in GIS, and geojson is used to store data most of the time. In this Openlayer actual combat, we draw rectangles by ourselves, and then export data through file-saver.

install dependencies

npm install file-saver --save

renderings

insert image description here

source code

/*
* @Author: 大剑师兰特(xiaozhuanlan),还是大剑师兰特(CSDN)
* @此源代码版权归大剑师兰特所有,可供学习或商业项目中借鉴,未经授权,不得重复地发表到博客、论坛,问答,git等公共空间或网站中。
* @Email: [email protected]
* @First published in CSDN
* @First published time: 2023-07-22
*/
<template>
    <div class=

Guess you like

Origin blog.csdn.net/cuclife/article/details/131793864