aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2013-02-09 23:29:41 +0000
committerChristopher Baines <cbaines8@gmail.com>2013-02-09 23:29:41 +0000
commitd8ab0f0573647acea2bdae1c07ea4cccecb6ae0d (patch)
tree0856ca72c5c707708ea70a3e297770c7816d2944 /resources
parent48bb641f4c2dd7af6c6b5e06daf26ccf055ab621 (diff)
downloadhealth-map-d8ab0f0573647acea2bdae1c07ea4cccecb6ae0d.tar
health-map-d8ab0f0573647acea2bdae1c07ea4cccecb6ae0d.tar.gz
Begin adding a minimap
Diffstat (limited to 'resources')
m---------resources/leaflet-minimap0
-rw-r--r--resources/map.js10
2 files changed, 8 insertions, 2 deletions
diff --git a/resources/leaflet-minimap b/resources/leaflet-minimap
new file mode 160000
+Subproject e1cc0a5978e6fd68642e5e276a77c7563b7df77
diff --git a/resources/map.js b/resources/map.js
index 7ec9cf5..1e962af 100644
--- a/resources/map.js
+++ b/resources/map.js
@@ -121,9 +121,12 @@ function catchmentAreaProperties(catchmentArea, healthPost) {
}
function initMap(self) {
- self.tileLayer = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ var tileUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ var tileAttribution = 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
+
+ self.tileLayer = L.tileLayer(tileUrl, {
maxZoom: 18,
- attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
+ attribution: tileAttribution
});
// Create the map
@@ -134,6 +137,9 @@ function initMap(self) {
var hash = new L.Hash(map);
+ var miniMapTileLayer = new L.TileLayer(tileUrl, {minZoom: 0, maxZoom: 13, attribution: tileAttribution });
+ var miniMap = new L.Control.MiniMap(miniMapTileLayer, { toggleDisplay: true }).addTo(map);
+
self.amenitiesShown = ["hospital"];
self.amenities = {};
self.amenityLayers = {}; // contains the layers for each amenity type