diff options
author | Christopher Baines <cbaines8@gmail.com> | 2013-02-09 23:29:41 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2013-02-09 23:29:41 +0000 |
commit | d8ab0f0573647acea2bdae1c07ea4cccecb6ae0d (patch) | |
tree | 0856ca72c5c707708ea70a3e297770c7816d2944 | |
parent | 48bb641f4c2dd7af6c6b5e06daf26ccf055ab621 (diff) | |
download | health-map-d8ab0f0573647acea2bdae1c07ea4cccecb6ae0d.tar health-map-d8ab0f0573647acea2bdae1c07ea4cccecb6ae0d.tar.gz |
Begin adding a minimap
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | index.html | 5 | ||||
m--------- | resources/leaflet-minimap | 0 | ||||
-rw-r--r-- | resources/map.js | 10 |
4 files changed, 15 insertions, 3 deletions
diff --git a/.gitmodules b/.gitmodules index 96e85b2..377a496 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "resources/leaflet-hash"] path = resources/leaflet-hash url = git://github.com/mlevans/leaflet-hash.git +[submodule "resources/leaflet-minimap"] + path = resources/leaflet-minimap + url = git://github.com/Norkart/Leaflet-MiniMap.git @@ -13,11 +13,14 @@ <link rel="stylesheet" href="resources/libs/locate/L.Control.Locate.css" /> <!--[if lte IE 8]><link rel="stylesheet" href="resources/libs/locate/L.Control.Locate.ie.css" /><![endif]--> - <link rel="stylesheet" href="resources/map.css" /> + <link rel="stylesheet" href="resources/map.css" /> + <link rel="stylesheet" href="resources/leaflet-minimap/src/Control.MiniMap.css" /> + <script src="resources/leaflet/dist/leaflet-src.js"></script> <script src="resources/leaflet-hash/leaflet-hash.js"></script> <script src="resources/libs/locate/L.Control.Locate.js"></script> + <script src="resources/leaflet-minimap/src/Control.MiniMap.js"></script> <script src="resources/op2geojson.js"></script> <script src="resources/data.js"></script> </head> 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 © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'; + + self.tileLayer = L.tileLayer(tileUrl, { maxZoom: 18, - attribution: 'Map data © <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 |