1. Initial integration of maop of science front-end with the backend.
This commit is contained in:
parent
619a906e42
commit
e564857261
5 changed files with 109 additions and 108 deletions
|
@ -7,10 +7,10 @@ function createScimapType(map, mapName) {
|
||||||
getTileUrl: function(coord, zoom) {
|
getTileUrl: function(coord, zoom) {
|
||||||
var normalizedCoord = getNormalizedCoord(coord, zoom);
|
var normalizedCoord = getNormalizedCoord(coord, zoom);
|
||||||
if (!normalizedCoord) {
|
if (!normalizedCoord) {
|
||||||
return "images/tiles/blank.png";
|
return mapOfScienceImageFolderPrefix + "tiles/blank.png";
|
||||||
}
|
}
|
||||||
var bound = Math.pow(2, zoom);
|
var bound = Math.pow(2, zoom);
|
||||||
return "images/tiles/tiles" + zoom + "_" + normalizedCoord.x + "_" +
|
return mapOfScienceImageFolderPrefix + "tiles/tiles" + zoom + "_" + normalizedCoord.x + "_" +
|
||||||
normalizedCoord.y + ".png";
|
normalizedCoord.y + ".png";
|
||||||
},
|
},
|
||||||
tileSize: new google.maps.Size(256, 256),
|
tileSize: new google.maps.Size(256, 256),
|
||||||
|
|
|
@ -42,7 +42,7 @@ function initVisModeController() {
|
||||||
|
|
||||||
function initMarkers() {
|
function initMarkers() {
|
||||||
downloader = new DownloadManager();
|
downloader = new DownloadManager();
|
||||||
loadMarkers(ENTITY_VIS_MODE, "smallSampleData.json", false);
|
loadMarkers(ENTITY_VIS_MODE, scienceMapDataURL, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initMap() {
|
function initMap() {
|
||||||
|
@ -60,8 +60,3 @@ function helper() {
|
||||||
$(window).load(function() {
|
$(window).load(function() {
|
||||||
initMap();
|
initMap();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,22 +5,34 @@
|
||||||
<#assign dataVisualizationURLRoot ="/visualizationData">
|
<#assign dataVisualizationURLRoot ="/visualizationData">
|
||||||
<#assign shortVisualizationURLRoot ="/vis">
|
<#assign shortVisualizationURLRoot ="/vis">
|
||||||
|
|
||||||
<#assign organizationURI ="${organizationURI?url}">
|
<#assign entityURI ="${entityURI?url}">
|
||||||
<#assign organizationVivoProfileURL = "${urls.base}/individual?uri=${organizationURI}">
|
<#assign entityVivoProfileURL = "${urls.base}/individual?uri=${entityURI}">
|
||||||
|
|
||||||
<#assign subOrganizationVivoProfileURL = "${urls.base}/individual?">
|
<#assign mapOfScienceVisParam = "map-of-science">
|
||||||
|
|
||||||
<#assign subOrganizationMapOfScienceCommonURL = "${urls.base}${shortVisualizationURLRoot}/map-of-science/">
|
<#assign subEntityVivoProfileURL = "${urls.base}/individual?">
|
||||||
|
|
||||||
|
<#assign subEntityMapOfScienceCommonURL = "${urls.base}${shortVisualizationURLRoot}/${mapOfScienceVisParam}/">
|
||||||
|
|
||||||
|
|
||||||
<#if organizationLocalName?has_content >
|
<#if entityLocalName?has_content >
|
||||||
|
|
||||||
<#assign organizationMapOfScienceURL = "${urls.base}${shortVisualizationURLRoot}/map-of-science/${organizationLocalName}">
|
<#assign entityMapOfScienceURL = "${urls.base}${shortVisualizationURLRoot}/${mapOfScienceVisParam}/${entityLocalName}">
|
||||||
|
|
||||||
<#else>
|
<#else>
|
||||||
|
|
||||||
<#assign organizationMapOfScienceURL = '${urls.base}${shortVisualizationURLRoot}/map-of-science/?uri=${organizationURI}'>
|
<#assign entityMapOfScienceURL = '${urls.base}${shortVisualizationURLRoot}/${mapOfScienceVisParam}/?uri=${entityURI}'>
|
||||||
|
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<#assign organizationMapOfScienceDataURL = "${urls.base}${dataVisualizationURLRoot}?vis=map-of-science&uri=${organizationURI}&vis_mode=json">
|
<#assign entityMapOfScienceDataURL = "${urls.base}${dataVisualizationURLRoot}?vis=${mapOfScienceVisParam}&uri=${entityURI}&output=json">
|
||||||
|
|
||||||
|
<script language="JavaScript" type="text/javascript">
|
||||||
|
|
||||||
|
var scienceMapDataURL = "${entityMapOfScienceDataURL}";
|
||||||
|
var imageFolderPrefix = "${urls.images}/visualization/";
|
||||||
|
var mapOfScienceImageFolderPrefix = imageFolderPrefix
|
||||||
|
+ "mapofscience/";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -4,35 +4,28 @@
|
||||||
corresponding changes in the included Templates. -->
|
corresponding changes in the included Templates. -->
|
||||||
|
|
||||||
|
|
||||||
<#include "scienceMapSetup.ftl">
|
<#include "mapOfScienceSetup.ftl">
|
||||||
|
|
||||||
<script language="JavaScript" type="text/javascript">
|
${scripts.add('<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.blockUI.min.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.dataTables.min.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/visualization-helper-functions.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/ClassExtendUtils.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/DownloadManager.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/GMapAPI.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/ColorStrategy.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/SizeCoding.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/CustomScimaps.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/Polygon.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/CustomMarker.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/MarkerManager.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/VisModeControllers.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/VisCommonControl.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/visualization/mapofscience/InitializeMap.js"></script>')}
|
||||||
|
|
||||||
$(document).ready(function() {
|
<#-- CSS files -->
|
||||||
|
|
||||||
var scienceMapDataURL = "${organizationMapOfScienceDataURL}";
|
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />',
|
||||||
|
'<link rel="stylesheet" href="${urls.base}/js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css" />')}
|
||||||
|
|
||||||
|
<div id="map_area" style="width: 640px; height: 480px;"></div>
|
||||||
$.ajax({
|
|
||||||
url: scienceMapDataURL
|
|
||||||
dataType: "json",
|
|
||||||
timeout: 5 * 60 * 1000,
|
|
||||||
success: function (data) {
|
|
||||||
|
|
||||||
if (data.error) {
|
|
||||||
|
|
||||||
alert("error");
|
|
||||||
alert(data);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
alert("success");
|
|
||||||
alert(data);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -269,10 +269,11 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
|
|
||||||
Map<String, Object> body = new HashMap<String, Object>();
|
Map<String, Object> body = new HashMap<String, Object>();
|
||||||
body.put("title", organizationLabel + " - Map of Science Visualization");
|
body.put("title", organizationLabel + " - Map of Science Visualization");
|
||||||
body.put("organizationURI", entityURI);
|
body.put("entityURI", entityURI);
|
||||||
body.put("organizationLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
|
body.put("entityLocalName", UtilityFunctions.getIndividualLocalName(entityURI, vreq));
|
||||||
|
body.put("entityLabel", organizationLabel);
|
||||||
body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
|
body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
|
||||||
body.put("organizationLabel", organizationLabel);
|
|
||||||
|
|
||||||
return new TemplateResponseValues(standaloneTemplate, body);
|
return new TemplateResponseValues(standaloneTemplate, body);
|
||||||
}
|
}
|
||||||
|
@ -447,7 +448,7 @@ public class MapOfScienceVisualizationRequestHandler implements
|
||||||
totalMappedPublications = result.getMappedPublications();
|
totalMappedPublications = result.getMappedPublications();
|
||||||
}
|
}
|
||||||
|
|
||||||
DecimalFormat percentageActivityFormat = new DecimalFormat("#.###");
|
DecimalFormat percentageActivityFormat = new DecimalFormat("#.#");
|
||||||
|
|
||||||
for (Map.Entry<Integer, Float> currentMappedDiscipline : disciplineToPublicationCount.entrySet()) {
|
for (Map.Entry<Integer, Float> currentMappedDiscipline : disciplineToPublicationCount.entrySet()) {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue