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
e0ba519c
Commit
e0ba519c
authored
1 year ago
by
Jakob Severin Steffensen Hjelseth
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into 'main'
Dev See merge request
!50
parents
cbfc7316
664083a6
No related branches found
Branches containing commit
No related tags found
2 merge requests
!52
Resolve "Fiks håndtering av output filformat"
,
!50
Dev
Pipeline
#235417
passed
1 year ago
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
index.html
+2
-1
2 additions, 1 deletion
index.html
javascript/mapChange.js
+133
-0
133 additions, 0 deletions
javascript/mapChange.js
javascript/tin.js
+16
-0
16 additions, 0 deletions
javascript/tin.js
with
151 additions
and
1 deletion
index.html
+
2
−
1
View file @
e0ba519c
...
...
@@ -38,7 +38,7 @@
</div>
<div
id=
"buttons2"
class=
"box2"
style=
"display: none;"
>
<p
style=
"width: 32vw;"
></p>
<button
class=
"button"
>
TIN
</button>
<button
class=
"button"
onclick=
"TIN()"
>
TIN
</button>
<button
class=
"button"
onclick=
"voronoi()"
>
Voronoi
</button>
</div>
</div>
...
...
@@ -277,6 +277,7 @@
<script
src=
"javascript/extract.js"
></script>
<script
src=
"javascript/mapChange.js"
></script>
<script
src=
"javascript/voronoi.js"
></script>
<script
src=
"javascript/tin.js"
></script>
<!-- Imported js -->
<!-- <script src="https://unpkg.com/shpjs@latest/dist/shp.js"></script> -->
...
...
This diff is collapsed.
Click to expand it.
javascript/mapChange.js
+
133
−
0
View file @
e0ba519c
...
...
@@ -23,6 +23,36 @@ var points = {
"
name
"
:
"
NTNU Dragvoll
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.388918
,
63.4203714
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Øya
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4347967
,
63.4235678
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Tyholt
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4143153
,
63.433756
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Solsiden
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
...
...
@@ -32,6 +62,106 @@ var points = {
"
properties
"
:
{
"
name
"
:
"
NTNU Moholt
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4032871
,
63.4340888
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Olavskvartalet
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4071882
,
63.4107064
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Lerkendal og Valgrinda
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.3861107
,
63.4288662
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Kalvskinnet
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4540302
,
63.4473022
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Ringve
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.3483128
,
63.4415347
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Heggdalen
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4492127
,
63.4521411
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Østmarka
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.3981586
,
63.4373727
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Brattørkaia
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.3992594
,
63.4152944
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Elgeseter
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4837531
,
63.4393659
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Rotvoll
"
}
},
{
"
type
"
:
"
Feature
"
,
"
geometry
"
:
{
"
type
"
:
"
Point
"
,
"
coordinates
"
:
[
10.4660445
,
63.42338
]
},
"
properties
"
:
{
"
name
"
:
"
NTNU Tunga
"
}
}
]
};
...
...
@@ -92,6 +222,9 @@ function changeMap() {
if
(
isVoronoi
)
{
voronoi
();
}
if
(
isTIN
)
{
TIN
();
}
// Legger til kartlagene som lå i kartet før en byttet kartmodus:
while
(
layersOnMap
.
length
>
0
)
{
...
...
This diff is collapsed.
Click to expand it.
javascript/tin.js
0 → 100644
+
16
−
0
View file @
e0ba519c
// Variabler:
var
isTIN
=
false
// Vises TIN'et i kartet?
// Selve TIN'et:
var
TINPolygons
=
turf
.
tin
(
NTNU_points
.
toGeoJSON
());
var
TINGeoJSON
=
L
.
geoJSON
(
TINPolygons
,
{
style
:
{
"
color
"
:
"
orangered
"
}});
function
TIN
()
{
if
(
isTIN
)
{
map
.
removeLayer
(
TINGeoJSON
);
isTIN
=
false
;
}
else
{
TINGeoJSON
.
addTo
(
map
);
isTIN
=
true
;
}
}
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