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
bc64a8da
Commit
bc64a8da
authored
1 year ago
by
Jakob Severin Steffensen Hjelseth
Browse files
Options
Downloads
Patches
Plain Diff
Begynne så smått
parent
f7022e68
No related branches found
Branches containing commit
No related tags found
2 merge requests
!20
Resolve "Lage sidebar for kartlagene"
,
!17
Resolve "Lage sidebar for kartlagene"
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
index.html
+4
-4
4 additions, 4 deletions
index.html
javascript/geoJSON.js
+61
-3
61 additions, 3 deletions
javascript/geoJSON.js
javascript/leafletLayerControl.js
+0
-0
0 additions, 0 deletions
javascript/leafletLayerControl.js
javascript/map.js
+0
-8
0 additions, 8 deletions
javascript/map.js
with
65 additions
and
15 deletions
index.html
+
4
−
4
View file @
bc64a8da
...
...
@@ -58,8 +58,8 @@
</div>
</div>
<div
style=
"margin-left: 10px; font-size: 18px; height: 50vh;"
>
<p
id=
"layers"
></p>
<div
id=
"layers"
style=
"margin-left: 10px; font-size: 18px; height: 50vh;"
>
</div>
</div>
...
...
@@ -155,10 +155,10 @@
<script
src=
"javascript/sidebar&boxes.js"
></script>
<script
src=
"javascript/openFileExplorer.js"
></script>
<script
src=
"javascript/fileHandler.js"
></script>
<script
src=
"javascript/geoJSON.js"
></script>
<script
src=
"/js/leaflet-0.7.2/leaflet.ajax.min.js"
></script>
<script
src=
"javascript/leafletLayerControl.js"
></script>
<!-- Imported js -->
<!-- <script src="https://unpkg.com/shpjs@latest/dist/shp.js"></script> -->
...
...
This diff is collapsed.
Click to expand it.
javascript/geoJSON.js
+
61
−
3
View file @
bc64a8da
var
rectangle
=
[{
var
rectangle
1
=
[{
"
type
"
:
"
Feature
"
,
"
properties
"
:
{
"
name
"
:
"
Gløshaugen
"
},
"
geometry
"
:
{
...
...
@@ -11,8 +11,66 @@ var rectangle = [{
[
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
"
:
"
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
geoLayer
=
L
.
geoJSON
().
addTo
(
map
);
var
layer1
=
L
.
geoJSON
().
addTo
(
map
);
var
layer2
=
L
.
geoJSON
().
addTo
(
map
);
layer1
.
addData
(
rectangle1
);
layer2
.
addData
(
rectangle2
);
geoLayer
.
addData
(
rectangle
);
document
.
getElementById
(
"
layers
"
).
innerHTML
+=
"
Universities
"
+
"
<br>
"
;
document
.
getElementById
(
"
layers
"
).
innerHTML
+=
"
Training centers
"
;
// Hvordan slå av og på et lag:
/*
map.on('click', function() {
if(map.hasLayer(layer1)) {
map.removeLayer(layer1);
} else {
map.addLayer(layer1);
}
});
*/
This diff is collapsed.
Click to expand it.
javascript/leafletLayerControl.js
0 → 100644
+
0
−
0
View file @
bc64a8da
This diff is collapsed.
Click to expand it.
javascript/map.js
+
0
−
8
View file @
bc64a8da
...
...
@@ -46,11 +46,3 @@ function activateMap() {
handler
.
enable
();
});
}
map
.
on
(
'
click
'
,
function
()
{
if
(
map
.
hasLayer
(
geoLayer
))
{
map
.
removeLayer
(
geoLayer
);
}
else
{
map
.
addLayer
(
geoLayer
);
}
});
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