aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilli Müller <willi.mueller@jups42.de>2012-12-02 05:29:07 -0800
committerWilli Müller <willi.mueller@jups42.de>2012-12-02 05:29:07 -0800
commitc2e6cb5ed6e35c42659f10f7e5703798938335a6 (patch)
tree1e9ffb6f47acfedeb77e00904234698667df2e3d
parent0e600790a155d31ee809e8b60c693d44acbae19a (diff)
parent788ed3a884343ce8ac0716d1f02c3a806b0abaac (diff)
downloadhealth-map-c2e6cb5ed6e35c42659f10f7e5703798938335a6.tar
health-map-c2e6cb5ed6e35c42659f10f7e5703798938335a6.tar.gz
Merge pull request #1 from cbaines/master
Basic Key
-rw-r--r--resources/map.css24
-rw-r--r--resources/map.js10
2 files changed, 34 insertions, 0 deletions
diff --git a/resources/map.css b/resources/map.css
index 8035091..918cf4d 100644
--- a/resources/map.css
+++ b/resources/map.css
@@ -6,3 +6,27 @@ body {
html, body, #map {
height: 100%;
}
+
+.info {
+ padding: 6px 8px;
+ font: 14px/16px Arial, Helvetica, sans-serif;
+ background: white;
+ background: rgba(255,255,255,0.8);
+ box-shadow: 0 0 15px rgba(0,0,0,0.2);
+ border-radius: 5px;
+}
+.info h4 {
+ margin: 0 0 5px;
+ color: #777;
+}
+.legend {
+ line-height: 18px;
+ color: #555;
+}
+.legend i {
+ width: 18px;
+ height: 18px;
+ float: left;
+ margin-right: 8px;
+ opacity: 0.7;
+}
diff --git a/resources/map.js b/resources/map.js
index e488a03..b9edc79 100644
--- a/resources/map.js
+++ b/resources/map.js
@@ -85,6 +85,16 @@ $(document).ready(function() {
map.locate({setView: true, maxZoom: 12});
+ var legend = L.control({position: 'bottomright'});
+ legend.onAdd = function (map) {
+ var div = L.DomUtil.create('div', 'info legend');
+
+ div.innerHTML += '<img href="resources/img/hospital.png"> Hospital<br>';
+
+ return div;
+ };
+ legend.addTo(map);
+
function buildLayer(data) {
return L.geoJson(data, {
onEachFeature: function(feature, layer) {