Commit cb384bb1 authored by Matija Obreza's avatar Matija Obreza

Global map on entry page

parent 5cf3401c
......@@ -336,7 +336,7 @@ public class ExplorerController extends BaseController {
@RequestMapping(value = "/explore/map", method = RequestMethod.GET)
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);
......
......@@ -389,6 +389,7 @@ oauth-client.active-tokens=List of tokens issued
maps.loading-map=Loading map...
maps.view-map=View map
maps.accession-map=Accession map
audit.createdBy=Created by {0}
audit.lastModifiedBy=Last updated by {0}
......
......@@ -4,11 +4,11 @@
<html>
<head>
<title><spring:message code="accession.page.data.title" /></title>
<title><spring:message code="maps.accession-map" /></title>
</head>
<body>
<h1>
<spring:message code="accession.page.data.title" />
<spring:message code="maps.accession-map" />
</h1>
<div class="main-col-header">
......@@ -33,7 +33,7 @@
opacity: 0.6
}).addTo(map);
L.tileLayer("{s}/explore/tile/{z}/{x}/{y}?filter=" + '${jsonFilter}', {
attribution: "Genesys",
attribution: "<a href='${props.baseUrl}'>Genesys</a>",
styleId: 22677,
subdomains: [${props.tileserverCdn}]
}).addTo(map);
......
......@@ -98,6 +98,13 @@
</div>
</div>
</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>
<content tag="javascript">
......@@ -114,6 +121,25 @@
messages: { noResults: '', results: function() {} },
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>
</content>
......
......@@ -1860,3 +1860,9 @@ html[dir="rtl"] ul.statistics .stats-number {
font-weight: bold;
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