160 lines
5.8 KiB
HTML
160 lines
5.8 KiB
HTML
<!--
|
|
MAPBOX - DRAWING
|
|
-->
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Draw a polygon and calculate its area</title>
|
|
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
|
|
|
|
<link href="https://api.mapbox.com/mapbox-gl-js/v3.12.0/mapbox-gl.css" rel="stylesheet">
|
|
<script src="https://api.mapbox.com/mapbox-gl-js/v3.12.0/mapbox-gl.js"></script>
|
|
<script src="https://unpkg.com/@turf/turf@6/turf.min.js"></script>
|
|
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.5.0/mapbox-gl-draw.js"></script>
|
|
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.5.0/mapbox-gl-draw.css" type="text/css">
|
|
|
|
<style>
|
|
body { margin: 0; padding: 0; }
|
|
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
|
|
|
|
.calculation-box {
|
|
height: 75px;
|
|
width: 150px;
|
|
position: absolute;
|
|
bottom: 40px;
|
|
left: 10px;
|
|
background-color: rgba(255, 255, 255, 0.9);
|
|
padding: 15px;
|
|
text-align: center;
|
|
}
|
|
|
|
p {
|
|
font-family: 'Open Sans';
|
|
margin: 0;
|
|
font-size: 13px;
|
|
}
|
|
|
|
#arrow-editor {
|
|
position: absolute;
|
|
display: none;
|
|
background: white;
|
|
padding: 10px;
|
|
border: 1px solid gray;
|
|
z-index: 10;
|
|
}
|
|
|
|
#arrow-editor label {
|
|
display: block;
|
|
margin-bottom: 5px;
|
|
font-family: sans-serif;
|
|
font-size: 13px;
|
|
}
|
|
|
|
#applyArrowChanges {
|
|
margin-top: 10px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="map"></div>
|
|
<div id="arrow-editor" style="position: absolute; background: white; padding: 10px; border: 1px solid #ccc; display: none; z-index: 1000;">
|
|
<h3>Arrow Editor</h3>
|
|
<label>Spline Step: <input id="splineStep" type="number" step="1"></label><br>
|
|
<label>Offset Distance: <input id="offsetDistance" type="number" step="1000"></label><br>
|
|
<label>Range: <input id="range" type="number" step="0.1" min="0"></label><br>
|
|
<label>Min Value: <input id="minValue" type="number" step="0.1" min="0"></label><br>
|
|
<label>Width Arrow: <input id="widthArrow" type="number" step="1"></label><br>
|
|
<label>Length Arrow: <input id="lengthArrow" type="number" step="1"></label><br>
|
|
|
|
<h4>Styling</h4>
|
|
<label>Fill Color: <input id="arrowFillColor" type="color" value="#000000"></label><br>
|
|
<label>Outline Color: <input id="arrowOutlineColor" type="color" value="#000000"></label><br>
|
|
<label>Opacity: <input id="arrowOpacity" type="number" min="0" max="1" step="0.1" value="0.6"></label><br>
|
|
|
|
<button id="applyArrowChanges">Apply Changes</button>
|
|
<button id="removeArrow">Remove Arrow</button>
|
|
|
|
</div>
|
|
|
|
<div id="frontline-editor" style="position: absolute; background: white; padding: 10px; border: 1px solid #ccc; display: none; z-index: 1000;">
|
|
<h3>Frontline Editor</h3>
|
|
<label>Spline Step: <input id="splineStepFrontline" type="number" step="1"></label><br>
|
|
<label>Offset Distance: <input id="offsetDistanceFrontline" type="number" step="1000"></label><br>
|
|
<label>Style:
|
|
<select id="styleFrontline">
|
|
<option value=1>Left Side</option>
|
|
<option value=2>Right Side</option>
|
|
<option value=3>Both Sides</option>
|
|
</select>
|
|
</label><br>
|
|
<h4>Protrusion</h4>
|
|
<label>Length: <input id="protrusionLength" type="number" step="100"></label><br>
|
|
<label>Start Size: <input id="protrusionStartSize" type="number" step="100"></label><br>
|
|
<label>End Size: <input id="protrusionEndSize" type="number" step="100"></label><br>
|
|
<label>Gap: <input id="protrusionGap" type="number" step="100"></label><br>
|
|
|
|
<h4>Styling LeftSide</h4>
|
|
<label>Fill Color: <input id="frontlineFillColorRight" type="color" value="#000000"></label><br>
|
|
<label>Outline Color: <input id="frontlineOutlineColorRight" type="color" value="#000000"></label><br>
|
|
<label>Opacity: <input id="frontlineOpacityRight" type="number" min="0" max="1" step="0.1" value="0.6"></label><br>
|
|
|
|
<h4>Styling RightSide</h4>
|
|
<label>Fill Color: <input id="frontlineFillColorLeft" type="color" value="#000000"></label><br>
|
|
<label>Outline Color: <input id="frontlineOutlineColorLeft" type="color" value="#000000"></label><br>
|
|
<label>Opacity: <input id="frontlineOpacityLeft" type="number" min="0" max="1" step="0.1" value="0.6"></label><br>
|
|
|
|
<button id="applyFrontlineChanges">Apply Changes</button>
|
|
<button id="removeFrontline">Remove Frontline</button>
|
|
</div>
|
|
|
|
<div id="drawStyleButtons" style="position: absolute; top: 10px; left: 50px; background: white; padding: 5px; z-index: 10;">
|
|
<button data-style="frontline">Frontline</button>
|
|
<button data-style="arrow">Arrow</button>
|
|
</div>
|
|
<script type="module" src="Drawing.js"></script>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
<!--
|
|
MAPBOX
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Display a map on a webpage</title>
|
|
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
|
|
<link href="https://api.mapbox.com/mapbox-gl-js/v3.12.0/mapbox-gl.css" rel="stylesheet">
|
|
<script src="https://api.mapbox.com/mapbox-gl-js/v3.12.0/mapbox-gl.js"></script>
|
|
<style>
|
|
body { margin: 0; padding: 0; }
|
|
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
<script type="module" src="MapPolygons.js"></script>
|
|
</body>
|
|
</html>
|
|
-->
|
|
|
|
<!--
|
|
CANVAS
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Vite App</title>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<canvas id="canvas" width="800" height="600"></canvas>
|
|
<script type="module" src="ArrowPoints.js"></script>
|
|
</body>
|
|
</html>
|
|
--> |