Openlayers combat: drawing lines with arrows

Sometimes such a scene is used in the Openlayers map, drawing several segments in a row, but it is necessary to know the direction of drawing to give people a hint of guidance. How to draw it? In this actual combat, the main thing is to deal with the display mode of the line segment, and add the arrow picture at the inflection point of the line segment, see the actual source code for details.

renderings

insert image description here

source code

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

Guess you like

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