]> git.openstreetmap.org Git - chef.git/blob - cookbooks/dev/files/default/ooc/map.js
web: add openstreetmap.com to certificate
[chef.git] / cookbooks / dev / files / default / ooc / map.js
1 $(document).ready(function () {
2   // Create a map
3   var map = L.map("map").fitBounds([[49.85,-10.5], [58.75, 1.9]]);
4
5   // Create NPE layer
6   var npe = L.tileLayer("https://{s}.ooc.openstreetmap.org/npe/{z}/{x}/{y}.png", {
7     minZoom: 6,
8     maxZoom: 15
9   });
10
11   // Create NPE Scotland layer
12   var npescotland = L.tileLayer("https://{s}.ooc.openstreetmap.org/npescotland/{z}/{x}/{y}.jpg", {
13     minZoom: 6,
14     maxZoom: 15
15   });
16
17   // Create 7th edition layer
18   var os7 = L.tileLayer("https://{s}.ooc.openstreetmap.org/os7/{z}/{x}/{y}.jpg", {
19     minZoom: 3,
20     maxZoom: 14
21   });
22
23   // Create 1st edition layer
24   var os1 = L.tileLayer("https://{s}.ooc.openstreetmap.org/os1/{z}/{x}/{y}.jpg", {
25     minZoom: 6,
26     maxZoom: 17
27   });
28
29   // Add OpenStreetMap layer
30   var osm = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
31     attribution: "© <a target=\"_parent\" href=\"https://www.openstreetmap.org\">OpenStreetMap</a> and contributors, under an <a target=\"_parent\" href=\"https://www.openstreetmap.org/copyright\">open license</a>",
32     maxZoom: 18
33   });
34
35   // Create a layer switcher
36   var layers = L.control.layers({
37     "OS NPE (Eng/Wales 1945-55) 1:50k": npe,
38     "OS NPE/7th (Scotland) 1:50k": npescotland,
39     "OS 7th Series (1947-60) 1:50k": os7,
40     "OS 1st Edition (1946-60) 1:25k": os1,
41     "OpenStreetMap": osm
42   } , null, {
43     collapsed: false
44   }).addTo(map);
45
46   // Add the NPE layer to the map
47   npe.addTo(map);
48 });