Add key for Google Maps (Map of Science)

This commit is contained in:
Graham Triggs 2016-07-28 22:10:17 +01:00
parent 649b0cfd45
commit f43db39084
3 changed files with 19 additions and 2 deletions

View file

@ -11,6 +11,7 @@ import java.util.Set;
import com.hp.hpl.jena.query.QuerySolution;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException;
import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer;
@ -451,6 +452,13 @@ public class MapOfScienceVisualizationRequestHandler implements VisualizationReq
body.put("vivoDefaultNamespace", vreq.getWebappDaoFactory().getDefaultNamespace());
ConfigurationProperties properties = ConfigurationProperties.getBean(vreq);
if (properties != null) {
body.put("googleMapsKey", properties.getProperty("google.maps.key", "AIzaSyCAexrHLqAu6Rb18DWqwrb-vx1PQQFkAQA"));
} else {
body.put("googleMapsKey", "AIzaSyCAexrHLqAu6Rb18DWqwrb-vx1PQQFkAQA");
}
return new TemplateResponseValues(standaloneTemplate, body);
}

View file

@ -217,6 +217,15 @@ VitroConnection.DataSource.validationQuery = SELECT 1
# OTHER OPTIONS
# -----------------------------------------------------------------------------
# Google Maps Key
# ---------------
# To use the Google Maps (e.g. Map of Science), you need to have a key for Google Maps
# See https://developers.google.com/maps/documentation/javascript/get-api-key
#
# When you have a key, uncomment the line below and add it here
#google.maps.key=
# AltMetric badges
# ----------------
# Options to embed AltMetric badges on information resource (e.g. journal article) pages

View file

@ -107,7 +107,7 @@ var i18nStrings = {
};
</script>
${scripts.add('<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>',
${scripts.add('<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=${googleMapsKey}"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></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/datatable/1.7.6/jquery.dataTables.min.js"></script>',