Openlayers combat: loading WKT files

In the interaction of OPenlayers, we often need to load some data. In this actual combat, the demonstration is to load WKT files.

The WKT format is a text format used to describe the spatial characteristics of two-dimensional and three-dimensional geometric objects. WKT is the abbreviation of "Well-Known Text", which is an open international standard defined and maintained by the Open Geospatial Consortium (OGC). The WKT format is commonly used to exchange spatial data between computer systems, for example between GIS (Geographic Information System) software and databases. The WKT format includes some basic geometric objects, such as points, lines, polygons, and circles, and some compound objects, such as polygon collections and geometric object collections.

renderings

insert image description here

source code

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

Guess you like

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