Commit cb384bb1 authored by Matija Obreza's avatar Matija Obreza
Browse files

Global map on entry page

parent 5cf3401c
...@@ -336,7 +336,7 @@ public class ExplorerController extends BaseController { ...@@ -336,7 +336,7 @@ public class ExplorerController extends BaseController {
@RequestMapping(value = "/explore/map", method = RequestMethod.GET) @RequestMapping(value = "/explore/map", method = RequestMethod.GET)
public String map(ModelMap model, @RequestParam(value = "crop", required = false, defaultValue = "") String cropName, public String map(ModelMap model, @RequestParam(value = "crop", required = false, defaultValue = "") String cropName,
@RequestParam(value = "filter", required = true) String jsonFilter) { @RequestParam(value = "filter", required = false, defaultValue="{}") String jsonFilter) {
ObjectNode jsonTree = updateFilterWithCrop(cropName, jsonFilter); ObjectNode jsonTree = updateFilterWithCrop(cropName, jsonFilter);
......
...@@ -389,6 +389,7 @@ oauth-client.active-tokens=List of tokens issued ...@@ -389,6 +389,7 @@ oauth-client.active-tokens=List of tokens issued
maps.loading-map=Loading map... maps.loading-map=Loading map...
maps.view-map=View map maps.view-map=View map
maps.accession-map=Accession map
audit.createdBy=Created by {0} audit.createdBy=Created by {0}
audit.lastModifiedBy=Last updated by {0} audit.lastModifiedBy=Last updated by {0}
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<html> <html>
<head> <head>
<title><spring:message code="accession.page.data.title" /></title> <title><spring:message code="maps.accession-map" /></title>
</head> </head>
<body> <body>
<h1> <h1>
<spring:message code="accession.page.data.title" /> <spring:message code="maps.accession-map" />
</h1> </h1>
<div class="main-col-header"> <div class="main-col-header">
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
opacity: 0.6 opacity: 0.6
}).addTo(map); }).addTo(map);
L.tileLayer("{s}/explore/tile/{z}/{x}/{y}?filter=" + '${jsonFilter}', { L.tileLayer("{s}/explore/tile/{z}/{x}/{y}?filter=" + '${jsonFilter}', {
attribution: "Genesys", attribution: "<a href='${props.baseUrl}'>Genesys</a>",
styleId: 22677, styleId: 22677,
subdomains: [${props.tileserverCdn}] subdomains: [${props.tileserverCdn}]
}).addTo(map); }).addTo(map);
......
...@@ -98,6 +98,13 @@ ...@@ -98,6 +98,13 @@
</div> </div>
</div> </div>
</c:if> </c:if>
<div class="content-block">
<h2><spring:message code="maps.accession-map" /></h2>
<div class="blurp">
<div id="globalmap" class="gis-map"></div>
</div>
</div>
</div> </div>
</div> </div>
<content tag="javascript"> <content tag="javascript">
...@@ -114,6 +121,25 @@ ...@@ -114,6 +121,25 @@
messages: { noResults: '', results: function() {} }, messages: { noResults: '', results: function() {} },
select: function(event, ui) { document.location.pathname='/acn/t/'+ui.item.value; } }); select: function(event, ui) { document.location.pathname='/acn/t/'+ui.item.value; } });
}); });
$("#globalmap").on("click", function(e) {
e.preventDefault();
window.location='<c:url value="/explore/map" />';
});
var map = L.map('globalmap', {minZoom:0, maxZoom:0, dragging:false, zoomControl:false, keyboard:false}).setView([20,0], 0);
L.tileLayer('https://otile{s}-s.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png', {
attribution: "MapQuest",
styleId: 22677,
noWrap: true,
subdomains: ['1','2','3','4'],
opacity: 0.6
}).addTo(map);
L.tileLayer("{s}/explore/tile/{z}/{x}/{y}?filter={}", {
attribution: "<a href='${props.baseUrl}'>Genesys</a>",
styleId: 22677,
noWrap: true,
subdomains: [${props.tileserverCdn}]
}).addTo(map);
}); });
</script> </script>
</content> </content>
......
...@@ -1860,3 +1860,9 @@ html[dir="rtl"] ul.statistics .stats-number { ...@@ -1860,3 +1860,9 @@ html[dir="rtl"] ul.statistics .stats-number {
font-weight: bold; font-weight: bold;
margin-bottom: 1px; margin-bottom: 1px;
} }
#globalmap.gis-map {
max-width: 250px;
height: 180px;
margin-top: 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment