config.put("baseUrl", contextPath);
config.put("apiUrl", contextPath + "/api");
List<AgencyWithCoverageBean> agenciesWithCoverage = _transitDataService.getAgenciesWithCoverage();
CoordinateBounds bounds = new CoordinateBounds();
for (AgencyWithCoverageBean awc : agenciesWithCoverage) {
if (awc.getLatSpan() <= 0 || awc.getLonSpan() <= 0)
continue;
bounds.addPoint(awc.getLat() + awc.getLatSpan() / 2,
awc.getLon() + awc.getLonSpan() / 2);
bounds.addPoint(awc.getLat() - awc.getLatSpan() / 2,
awc.getLon() - awc.getLonSpan() / 2);
}
if (bounds.isEmpty()) {
config.put("centerLat", 0.0);
config.put("centerLon", 0.0);
config.put("spanLat", 180.0);
config.put("spanLon", 180.0);
} else {
config.put("centerLat", (bounds.getMinLat() + bounds.getMaxLat()) / 2);
config.put("centerLon", (bounds.getMinLon() + bounds.getMaxLon()) / 2);
config.put("spanLat", bounds.getMaxLat() - bounds.getMinLat());
config.put("spanLon", bounds.getMaxLon() - bounds.getMinLon());
}
config.put("hasDefaultServiceArea",
_serviceAreaService.hasDefaultServiceArea());
config.put("googleMapsApiKey", _googleMapsApiKey);