Commit 34963593 authored by Matija Obreza's avatar Matija Obreza

Cleanup

- Fixed bugged JS formatted code
- Updated deprecated ObjectMapper#put call
parent 0f1257e2
......@@ -108,7 +108,7 @@ public class MappingServiceImpl implements MappingService {
final ObjectNode geoJson = mapper.createObjectNode();
geoJson.put("type", "FeatureCollection");
final ArrayNode featuresArray = geoJson.arrayNode();
geoJson.put("features", featuresArray);
geoJson.set("features", featuresArray);
filterService.listGeo(filters, limit, new RowCallbackHandler() {
@Override
......@@ -119,16 +119,16 @@ public class MappingServiceImpl implements MappingService {
feature.put("id", rs.getLong("id"));
ObjectNode geometry;
feature.put("geometry", geometry = feature.objectNode());
feature.set("geometry", geometry = feature.objectNode());
geometry.put("type", "Point");
ArrayNode coordArray;
geometry.put("coordinates", coordArray = geometry.arrayNode());
geometry.set("coordinates", coordArray = geometry.arrayNode());
coordArray.add(rs.getDouble("longitude"));
coordArray.add(rs.getDouble("latitude"));
ObjectNode properties;
feature.put("properties", properties = feature.objectNode());
feature.set("properties", properties = feature.objectNode());
properties.put("acceNumb", rs.getString("acceNumb"));
properties.put("instCode", rs.getString("instCode"));
properties.put("datum", rs.getString("datum"));
......
......@@ -1076,30 +1076,22 @@
<script type="text/javascript">
jQuery(document).ready(function () {
var map = L.map('map', {scrollWheelZoom: false}).setView([
$ {
accessionGeo.latitude
},
$ {accessionGeo.longitude}
${accessionGeo.latitude}, ${accessionGeo.longitude}
], 4);
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', {
attribution: "Tiles &copy; Esri &mdash; Esri, DeLorme, NAVTEQ",
maxZoom: 16
}).addTo(map);
var marker = L.marker([
$ {
accessionGeo.latitude
},
$ {accessionGeo.longitude}
${accessionGeo.latitude}, ${accessionGeo.longitude}
]).addTo(map);
});
</script>
</c:if>
<c:if test="${worldclimJson ne null}">
<script type="text/javascript">
var monthNames = $ {
jspHelper.toJson(jspHelper.monthShortNames(pageContext.response.locale))
};
var worldclim = $ {jspHelper.toJson(worldclimJson)};
var monthNames = ${jspHelper.toJson(jspHelper.monthShortNames(pageContext.response.locale))};
var worldclim = ${jspHelper.toJson(worldclimJson)};
function arrayToData(array) {
var ret = [];
for (var i = 0; i < 12; i++) {
......
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