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
1d9ba399
Commit
1d9ba399
authored
1 year ago
by
Jakob Severin Steffensen Hjelseth
Browse files
Options
Downloads
Patches
Plain Diff
Ferdig?
parent
d74c6eda
No related branches found
Branches containing commit
No related tags found
2 merge requests
!41
Resolve "Farger på datalagene"
,
!40
Ferdig?
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
index.html
+3
-0
3 additions, 0 deletions
index.html
javascript/colors.js
+25
-0
25 additions, 0 deletions
javascript/colors.js
javascript/geoJSON.js
+10
-8
10 additions, 8 deletions
javascript/geoJSON.js
with
38 additions
and
8 deletions
index.html
+
3
−
0
View file @
1d9ba399
...
...
@@ -12,6 +12,9 @@
<!-- Turfjs -->
<script
src=
'https://unpkg.com/@turf/turf@6/turf.min.js'
></script>
<!-- Coloring the map layers -->
<script
src=
"javascript/colors.js"
></script>
</head>
<body
class=
"standard"
>
...
...
This diff is collapsed.
Click to expand it.
javascript/colors.js
0 → 100644
+
25
−
0
View file @
1d9ba399
// Her farges alle lagene i kartet
var
count
=
0
;
var
colors
=
[
"
blue
"
,
"
red
"
,
"
yellow
"
,
"
green
"
,
"
purple
"
,
"
orange
"
,
];
function
getStyle
()
{
var
myStyle
=
{
"
color
"
:
colors
[
count
]
};
count
++
;
if
(
count
==
colors
.
length
)
{
count
=
0
;
}
return
myStyle
}
This diff is collapsed.
Click to expand it.
javascript/geoJSON.js
+
10
−
8
View file @
1d9ba399
...
...
@@ -69,18 +69,20 @@ var TC = {
]
};
var
test1
=
L
.
geoJSON
();
var
test2
=
L
.
geoJSON
();
var
test1
=
L
.
geoJSON
(
U
,
{
style
:
getStyle
()}
);
var
test2
=
L
.
geoJSON
(
TC
,
{
style
:
getStyle
()}
);
test1
.
addData
(
U
);
test2
.
addData
(
TC
);
//addMapLayer(test1, U);
//addMapLayer(test2, TC);
//test1.addData(U);
//test2.addData(TC);
// Det jeg skal ha med i ferdig versjon:
var
Arealdekke
=
L
.
geoJSON
();
var
Bygg_f
=
L
.
geoJSON
();
var
Bygg_l
=
L
.
geoJSON
();
var
Samferdsel
=
L
.
geoJSON
();
var
Arealdekke
=
L
.
geoJSON
(
null
,
{
style
:
getStyle
()}
);
var
Bygg_f
=
L
.
geoJSON
(
null
,
{
style
:
getStyle
()}
);
var
Bygg_l
=
L
.
geoJSON
(
null
,
{
style
:
getStyle
()}
);
var
Samferdsel
=
L
.
geoJSON
(
null
,
{
style
:
getStyle
()}
);
fetch
(
"
javascript/exampleData/Arealdekke_klippa.geojson
"
).
then
(
function
(
response
)
{
return
response
.
json
();
...
...
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