Default to show date layer, fix zindex

This commit is contained in:
Tom Russell 2018-08-02 18:47:19 +01:00
parent 974a29ed6a
commit 0dcfdeaad6

View File

@ -27,8 +27,8 @@ function map(){
attributionControl: false, attributionControl: false,
maxZoom: 18, maxZoom: 18,
minZoom: 7, minZoom: 7,
center: ([51.507222, -0.1275]), center: ([51.5245255, -0.1338422]),
zoom: 14, zoom: 16,
doubleClickZoom: false, doubleClickZoom: false,
}); });
@ -37,19 +37,24 @@ function map(){
attr.addAttribution("Contains OS data © Crown copyright: OS Maps baselayers and building outlines. Building attribute data is © Colouring London contributors"); attr.addAttribution("Contains OS data © Crown copyright: OS Maps baselayers and building outlines. Building attribute data is © Colouring London contributors");
attr.addTo(map); attr.addTo(map);
L.control.zoom({position: 'topright'}).addTo(map); L.control.zoom({position: 'topright'}).addTo(map);
L.control.layers(baseMaps, {}, {position: 'topright'}).addTo(map); L.control.layers(baseMaps, {}, {
position: 'topright',
autoZIndex: false
}).addTo(map);
// Rendered layer // Rendered layer
var outline_layer = L.tileLayer('/tiles/outline/{z}/{x}/{y}.png', { var outline_layer = L.tileLayer('/tiles/date_year/{z}/{x}/{y}.png', {
maxZoom: 20, maxZoom: 20,
minZoom: 14 minZoom: 14
}) })
outline_layer.setZIndex(10);
outline_layer.addTo(map); outline_layer.addTo(map);
var highlight_layer = L.tileLayer('/tiles/highlight/{z}/{x}/{y}.png', { var highlight_layer = L.tileLayer('/tiles/highlight/{z}/{x}/{y}.png', {
maxZoom: 20, maxZoom: 20,
minZoom: 14 minZoom: 14
}) })
highlight_layer.setZIndex(20);
var highlight_layer_added = false; var highlight_layer_added = false;
// Query for building on click // Query for building on click