Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
1c7cf7fc
Commit
1c7cf7fc
authored
May 06, 2016
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extra base map tile providers
parent
f20853bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
18 deletions
+34
-18
src/main/webapp/WEB-INF/jsp/accession/map.jsp
src/main/webapp/WEB-INF/jsp/accession/map.jsp
+34
-18
No files found.
src/main/webapp/WEB-INF/jsp/accession/map.jsp
View file @
1c7cf7fc
...
...
@@ -37,10 +37,14 @@
<ul
class=
"dropdown-menu"
>
<li>
<label
class=
"label-map-provider"
><input
class=
"map-provider"
name=
"provider"
style=
'margin-right: 10px;margin-left: 5px'
<label
class=
"label-map-provider"
><input
class=
"map-provider"
value=
"mapQuest"
name=
"provider"
style=
'margin-right: 10px;margin-left: 5px'
type=
'radio'
>
MapQuest
</label>
<label
class=
"label-map-provider"
><input
name=
"provider"
class=
"map-provider"
style=
'margin-right: 10px;margin-left: 5px'
<label
class=
"label-map-provider"
><input
name=
"provider"
value=
"openstreetmap"
class=
"map-provider"
style=
'margin-right: 10px;margin-left: 5px'
type=
'radio'
>
Openstreetmap
</label>
<label
class=
"label-map-provider"
><input
name=
"provider"
value=
"esriGray"
class=
"map-provider"
style=
'margin-right: 10px;margin-left: 5px'
type=
'radio'
>
ESRI Gray
</label>
<label
class=
"label-map-provider"
><input
name=
"provider"
value=
"esriTopo"
class=
"map-provider"
style=
'margin-right: 10px;margin-left: 5px'
type=
'radio'
>
ESRI Topo
</label>
</li>
</ul>
...
...
@@ -122,18 +126,25 @@
var
map
=
L
.
map
(
'
map
'
).
setView
([
20
,
0
],
2
);
var
topPane
=
map
.
_createPane
(
'
leaflet-top-pane
'
,
map
.
getPanes
().
mapPane
);
var
mapProviders
=
{
O
penstreetmap
:
L
.
tileLayer
(
'
https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
'
,
{
o
penstreetmap
:
L
.
tileLayer
(
'
https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
'
,
{
attribution
:
'
© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>
'
}),
/* OpenMapSurfer_Grayscale: L.tileLayer('http://openmapsurfer.uni-hd.de/tiles/roadsg/x={x}&y={y}&z={z}', {
maxZoom: 19,
attribution: 'Imagery from <a target="_blank" href="http://giscience.uni-hd.de/">GIScience Research Group, University of Heidelberg</a>, Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}),*/
M
apQuest
:
L
.
tileLayer
(
'
https://otile{s}-s.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png
'
,
{
m
apQuest
:
L
.
tileLayer
(
'
https://otile{s}-s.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png
'
,
{
attribution
:
"
MapQuest
"
,
styleId
:
22677
,
subdomains
:
[
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
],
opacity
:
0.6
}),
esriGray
:
L
.
tileLayer
(
'
https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}
'
,
{
attribution
:
'
Tiles © Esri — Esri, DeLorme, NAVTEQ
'
,
maxZoom
:
16
}),
esriTopo
:
L
.
tileLayer
(
'
https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}
'
,
{
attribution
:
'
Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community
'
})
/*Stamen_TonerLines: L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lines/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
...
...
@@ -194,15 +205,7 @@
})
}
};
var
cookieValue
=
cookieUtils
.
getCookie
(
'
mapProviders
'
)
||
'
MapQuest
'
;
[].
forEach
.
call
(
$
(
'
.label-map-provider
'
),
function
(
label
){
label
.
innerHTML
.
indexOf
(
cookieValue
)
>
1
?
$
(
label
).
find
(
'
input:radio
'
).
prop
(
'
checked
'
,
true
)
:
$
(
label
).
find
(
'
input:radio
'
).
prop
(
'
checked
'
,
false
);
});
mapProviders
[
cookieValue
].
addTo
(
map
);
topPane
.
appendChild
(
mapProviders
[
cookieValue
].
getContainer
());
mapProviders
[
cookieValue
].
setZIndex
(
0
);
$
(
document
).
on
(
'
cookieUpdate
'
,
function
()
{
for
(
var
key
in
mapProviders
)
{
map
.
removeLayer
(
mapProviders
[
key
]);
...
...
@@ -212,13 +215,14 @@
topPane
.
appendChild
(
mapProviders
[
cookieUtils
.
getCookie
(
'
mapProviders
'
)].
getContainer
());
mapProviders
[
cookieUtils
.
getCookie
(
'
mapProviders
'
)].
setZIndex
(
0
);
}
else
{
mapProviders
.
M
apQuest
.
addTo
(
map
);
mapProviders
.
m
apQuest
.
addTo
(
map
);
topPane
.
appendChild
(
mapProviders
[
cookieUtils
.
getCookie
(
'
mapProviders
'
)].
getContainer
());
mapProviders
.
M
apQuest
.
setZIndex
(
0
);
mapProviders
.
m
apQuest
.
setZIndex
(
0
);
}
});
$
(
"
body
"
).
on
(
"
click
"
,
"
.map-provider
"
,
function
(
e
)
{
var
providerName
=
$
(
this
).
parent
().
text
();
$
(
'
.map-provider
'
).
click
(
function
(
e
)
{
var
providerName
=
$
(
this
).
val
();
if
(
$
(
this
).
is
(
"
:checked
"
))
{
cookieUtils
.
setCookie
(
'
mapProviders
'
,
providerName
,
0
);
$
(
document
).
trigger
(
'
cookieUpdate
'
);
...
...
@@ -227,10 +231,22 @@
cookieUtils
.
setCookie
(
'
mapProviders
'
,
providerName
,
0
);
$
(
document
).
trigger
(
'
cookieUpdate
'
);
}
});
$
(
'
#color select
'
).
simplecolorpicker
();
var
selectedBaseMap
=
cookieUtils
.
getCookie
(
'
mapProviders
'
)
||
'
esriGray
'
;
if
(
mapProviders
[
selectedBaseMap
]
===
undefined
)
{
selectedBaseMap
=
'
esriGray
'
;
}
[].
forEach
.
call
(
$
(
'
.label-map-provider input:radio
'
),
function
(
radio
){
$
(
radio
).
prop
(
'
checked
'
,
$
(
radio
).
val
()
===
selectedBaseMap
);
});
mapProviders
[
selectedBaseMap
].
addTo
(
map
);
topPane
.
appendChild
(
mapProviders
[
selectedBaseMap
].
getContainer
());
mapProviders
[
selectedBaseMap
].
setZIndex
(
0
);
$
(
"
#save-filter
"
).
on
(
"
click
"
,
function
(
event
)
{
event
.
preventDefault
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment