Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProgGis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Severin Steffensen Hjelseth
ProgGis
Commits
886ab386
Commit
886ab386
authored
1 year ago
by
Jakob Severin Steffensen Hjelseth
Browse files
Options
Downloads
Patches
Plain Diff
Begynne og generell layout
parent
aa33404e
No related branches found
Branches containing commit
No related tags found
2 merge requests
!26
Resolve "Buffer"
,
!24
Resolve "Buffer"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
css/style.css
+4
-0
4 additions, 0 deletions
css/style.css
index.html
+13
-0
13 additions, 0 deletions
index.html
javascript/buffer.js
+24
-0
24 additions, 0 deletions
javascript/buffer.js
with
41 additions
and
0 deletions
css/style.css
+
4
−
0
View file @
886ab386
...
...
@@ -5,6 +5,10 @@
margin
:
0
;
}
p
{
font-size
:
18px
;
}
.box
{
font-family
:
monospace
;
background-color
:
orange
;
...
...
This diff is collapsed.
Click to expand it.
index.html
+
13
−
0
View file @
886ab386
...
...
@@ -75,6 +75,17 @@
<path
d=
"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"
/>
</svg>
</div>
<p>
Choose a layer to create a buffer around:
</p>
<select
id=
"bufferSelect"
>
Layer:
</select>
<p>
Write the distance you want for the buffer (in meter):
</p>
<input
id=
"bufferDistance"
>
<p>
Choose a name for the new buffer:
</p>
<input
id=
"bufferName"
><br>
<button
class=
"button"
style=
"font-size: 25px;"
onclick=
"makeBuffer()"
>
Make buffer
</button>
</div>
<div
id=
"differenceBox"
class=
"box"
>
...
...
@@ -179,8 +190,10 @@
<script
src=
"javascript/fileHandler.js"
></script>
<script
src=
"javascript/geoJSON.js"
></script>
<script
src=
"javascript/leafletLayerControl.js"
></script>
<script
src=
"javascript/buffer.js"
></script>
<!-- Imported js -->
<script
src=
'https://unpkg.com/@turf/turf@6/turf.min.js'
></script>
<!-- <script src="https://unpkg.com/shpjs@latest/dist/shp.js"></script> -->
</body>
...
...
This diff is collapsed.
Click to expand it.
javascript/buffer.js
0 → 100644
+
24
−
0
View file @
886ab386
/*
Link til nettside med turfjs-funksjoner:
https://turfjs.org/docs/
*/
// Fyller select med alternativ:
var
s
=
document
.
getElementById
(
"
bufferSelect
"
);
s
.
options
.
lenght
=
0
;
for
(
key
in
overlayMaps
)
{
s
.
add
(
new
Option
(
key
,
overlayMaps
[
key
]));
}
function
makeBuffer
()
{
var
layer
=
document
.
getElementById
(
"
bufferSelect
"
).
value
;
var
distance
=
parseFloat
(
document
.
getElementById
(
"
bufferDistance
"
).
value
)
/
10
^
3
;
var
name
=
document
.
getElementById
(
"
bufferName
"
).
value
;
var
buffer
=
L
.
geoJSON
(
turf
.
buffer
(
layer
,
distance
,
{
units
:
"
kilometers
"
})).
addTo
(
map
);
overlayMaps
[
name
]
=
buffer
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment