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
d612f227
Commit
d612f227
authored
1 year ago
by
Jakob Severin Steffensen Hjelseth
Browse files
Options
Downloads
Plain Diff
Merge branch '5-lage-sidebar-for-kartlagene' into 'main'
Test av å hente navn på geoJSON-lag Closes
#5
See merge request
!18
parents
29bf8253
3333a4b7
No related branches found
Branches containing commit
No related tags found
2 merge requests
!20
Resolve "Lage sidebar for kartlagene"
,
!18
Test av å hente navn på geoJSON-lag
Pipeline
#234248
passed
1 year ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
javascript/geoJSON.js
+2
-73
2 additions, 73 deletions
javascript/geoJSON.js
with
2 additions
and
73 deletions
javascript/geoJSON.js
+
2
−
73
View file @
d612f227
var
rectangle1
=
{
"
type
"
:
"
FeatureCollection
"
,
"
name
"
:
"
Universities
"
,
"
features
"
:
[
{
"
type
"
:
"
Feature
"
,
"
properties
"
:
{
"
name
"
:
"
Gløshaugen
"
},
"
geometry
"
:
{
"
type
"
:
"
Polygon
"
,
"
coordinates
"
:
[[
[
10.403787
,
63.420031
],
[
10.410954
,
63.414691
],
[
10.404863
,
63.414188
],
[
10.398170
,
63.418901
],
[
10.403787
,
63.420031
]
]]
}
},
{
"
type
"
:
"
Feature
"
,
"
properties
"
:
{
"
name
"
:
"
Dragvoll
"
},
"
geometry
"
:
{
"
type
"
:
"
Polygon
"
,
"
coordinates
"
:
[[
[
10.467217
,
63.409471
],
[
10.471829
,
63.408921
],
[
10.47094
,
63.406668
],
[
10.466968
,
63.407128
],
[
10.467217
,
63.409471
]
]]
}
}
]
};
var
rectangle2
=
{
"
type
"
:
"
FeatureCollection
"
,
"
name
"
:
"
Training centers
"
,
"
features
"
:
[
{
"
type
"
:
"
Feature
"
,
"
properties
"
:
{
"
name
"
:
"
SIT Gløshaugen
"
},
"
geometry
"
:
{
"
type
"
:
"
Polygon
"
,
"
coordinates
"
:
[[
[
10.403855
,
63.421078
],
[
10.404845
,
63.421427
],
[
10.40556
,
63.421042
],
[
10.404572
,
63.420705
],
[
10.403855
,
63.421078
]
]]
}
},
{
"
type
"
:
"
Feature
"
,
"
properties
"
:
{
"
name
"
:
"
SIT Dragvoll
"
},
"
geometry
"
:
{
"
type
"
:
"
Polygon
"
,
"
coordinates
"
:
[[
[
10.474145
,
63.407263
],
[
10.475657
,
63.407148
],
[
10.475491
,
63.406157
],
[
10.473766
,
63.406265
],
[
10.474145
,
63.407263
]
]]
}
}
]
};
var
layer1
=
L
.
geoJSON
().
addTo
(
map
);
var
layer2
=
L
.
geoJSON
().
addTo
(
map
);
...
...
@@ -81,11 +13,8 @@ fetch("javascript/exampleData/TrainingCenters.geojson").then(function(response)
layer2
.
addData
(
data
);
})
//layer1.addData(rectangle1);
//layer2.addData(rectangle2);
document
.
getElementById
(
"
layers
"
).
innerHTML
+=
"
Universities
"
+
"
<br>
"
;
document
.
getElementById
(
"
layers
"
).
innerHTML
+=
"
Training centers
"
;
document
.
getElementById
(
"
layers
"
).
innerHTML
+=
layer1
.
name
+
"
<br>
"
;
document
.
getElementById
(
"
layers
"
).
innerHTML
+=
layer2
.
name
;
// Hvordan slå av og på et lag:
...
...
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