From d8ab0f0573647acea2bdae1c07ea4cccecb6ae0d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 9 Feb 2013 23:29:41 +0000 Subject: Begin adding a minimap --- resources/leaflet-minimap | 1 + resources/map.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 160000 resources/leaflet-minimap (limited to 'resources') diff --git a/resources/leaflet-minimap b/resources/leaflet-minimap new file mode 160000 index 0000000..e1cc0a5 --- /dev/null +++ b/resources/leaflet-minimap @@ -0,0 +1 @@ +Subproject commit e1cc0a5978e6fd68642e5e276a77c7563b7df774 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 © OpenStreetMap contributors'; + + self.tileLayer = L.tileLayer(tileUrl, { maxZoom: 18, - attribution: 'Map data © OpenStreetMap 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 -- cgit v1.2.3