current position:Home>17 ArcGIS API for JavaScript 4.18 draw points, lines and faces with the mouse

17 ArcGIS API for JavaScript 4.18 draw points, lines and faces with the mouse

2022-04-29 16:09:33X Beichen North

Write it at the front

Here is just a code record to draw points by dragging with the mouse 、 Line 、 The process of polygon elements , The code is simple , There is no need to write too much introduction .

 

Final effect

 

The overall code

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title> Point line surface drawing </title>
		<link
			rel="stylesheet"
			href="https://js.arcgis.com/4.18/esri/themes/light/main.css"
		/>
		<style>
			html,
			body,
			#mapview {
				width: 100%;
				height: 100%;
				margin: 0 !important;
			}
			.drawtool {
				position: absolute;
				top: 50px;
				right: 30px;

copyright notice
author[X Beichen North],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204291427264628.html

Random recommended