Only use Google Maps API key if configured

This commit is contained in:
Graham Triggs 2016-07-29 16:42:31 +01:00
parent 2ca805b4ff
commit 6881257f57
2 changed files with 10 additions and 5 deletions

View file

@ -454,9 +454,10 @@ public class MapOfScienceVisualizationRequestHandler implements VisualizationReq
ConfigurationProperties properties = ConfigurationProperties.getBean(vreq);
if (properties != null) {
body.put("googleMapsKey", properties.getProperty("google.maps.key", "AIzaSyCAexrHLqAu6Rb18DWqwrb-vx1PQQFkAQA"));
} else {
body.put("googleMapsKey", "AIzaSyCAexrHLqAu6Rb18DWqwrb-vx1PQQFkAQA");
String key = properties.getProperty("google.maps.key");
if (!StringUtils.isEmpty(key)) {
body.put("googleMapsKey", key);
}
}
return new TemplateResponseValues(standaloneTemplate, body);